CREATE TABLE textq_results (
	textq_result_id int NOT NULL,
	resource_id int NOT NULL,
	user_id int NOT NULL,
	marker_user_id int,
	feedback_big_string_id int NOT NULL,
	comments_big_string_id int NOT NULL,
	status int NOT NULL,
	general_mark int,
	mark int,
	adjusted_mark int,
	when_saved TIMESTAMP,
	when_marked TIMESTAMP,
	CONSTRAINT PK_textq_results PRIMARY KEY
	(
		textq_result_id
	),
	CONSTRAINT FK_textq_result_to_objects FOREIGN KEY
	(
		textq_result_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_tq_result_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_textq_result_to_users FOREIGN KEY
	(
		user_id
	) REFERENCES users (
		user_id
	),
	CONSTRAINT FK_tq_f_to_big_strings FOREIGN KEY
	(
		feedback_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_tq_c_to_big_strings FOREIGN KEY
	(
		comments_big_string_id
	) REFERENCES big_strings (
		big_string_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(43,	'building2', 'textq_results', 'org.bodington.assessment.TextQResult')
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(43, 1, 'textq_result_id', 'setTextQResultId', 'getTextQResultId', '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(43, 2, 'resource_id', 'setResourceId', 'getResourceId', '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(43, 3, 'user_id', 'setUserId', 'getUserId', '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(43, 4, 'marker_user_id', 'setMarkerUserId', 'getMarkerUserId', '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(43, 5, 'feedback_big_string_id', 'setFeedbackBigStringId', 'getFeedbackBigStringId', '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(43, 6, 'comments_big_string_id', 'setCommentsBigStringId', 'getCommentsBigStringId', '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(43, 7, 'status', 'setStatus', 'getStatus', 'int', 'int', 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(43, 8, 'general_mark', 'setGeneralMark', 'getGeneralMark', 'java.lang.Integer', 'java.lang.Integer', 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(43, 9, 'mark', 'setMark', 'getMark', 'java.lang.Integer', 'java.lang.Integer', 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(43, 10, 'adjusted_mark', 'setAdjustedMark', 'getAdjustedMark', 'java.lang.Integer', 'java.lang.Integer', 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(43, 11, 'when_saved', 'setWhenSaved', 'getWhenSaved', 'java.sql.Timestamp', 'java.sql.Timestamp', 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(43, 12, 'when_marked', 'setWhenMarked', 'getWhenMarked', 'java.sql.Timestamp', 'java.sql.Timestamp', 0, null, null, null )
GO



