CREATE TABLE pigeonhole_responses (
    pigeonhole_response_id int NOT NULL,
	pigeonhole_entry_id int NOT NULL,
	pigeonhole_question_id int NOT NULL,
	mark int,
	CONSTRAINT PK_pigeonhole_responses PRIMARY KEY
	(
		pigeonhole_response_id
	),
	CONSTRAINT FK_ph_response_to_objects FOREIGN KEY
	(
		pigeonhole_response_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_ph_response_to_entries FOREIGN KEY
	(
		pigeonhole_entry_id
	) REFERENCES pigeonhole_entries (
		pigeonhole_entry_id
	),
	CONSTRAINT FK_ph_response_to_questions FOREIGN KEY
	(
		pigeonhole_question_id
	) REFERENCES pigeonhole_questions (
		pigeonhole_question_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(36,	'building2', 'pigeonhole_responses', 'org.bodington.assessment.PigeonHoleResponse')
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(36, 1, 'pigeonhole_response_id', 'setPigeonHoleResponseId', 'getPigeonHoleResponseId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 1, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(36, 2, 'pigeonhole_entry_id', 'setPigeonHoleEntryId', 'getPigeonHoleEntryId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(36, 3, 'pigeonhole_question_id', 'setPigeonHoleQuestionId', 'getPigeonHoleQuestionId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(36, 4, 'mark', 'setMark', 'getMark', 'java.lang.Integer', 'java.lang.Integer', 0, null, null, null )
GO
