Commit 7451bc59 by Nilu

BO changes

parent bcc64b13
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="quest_number" type="Long" nullable="true"/>
<column name="answer_number" type="Long" nullable="true"/> <column name="answer_number" type="Long" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="true"/> <column name="candidate_id" type="Long" length="11" nullable="true"/>
<column name="quest_number" type="Long" length="11" nullable="true"/> <column name="quest_number" type="Long" length="11" nullable="true"/>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="reverse_score_flag" type="String" nullable="true" length="15"/> <column name="reverse_score_flag" type="Boolean" nullable="true"/>
<column name="factor_number" type="Long" length="11" nullable="true"/> <column name="factor_number" type="Long" length="11" nullable="true"/>
<column name="quest_number" type="Long" length="11" nullable="true"/> <column name="quest_number" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<column name="from_score" type="Long" nullable="true"/> <column name="from_score" type="Long" nullable="true"/>
<column name="to_score" type="Long" nullable="true"/> <column name="to_score" type="Long" nullable="true"/>
<column name="narrative_code" type="String" nullable="true" length="15"/> <column name="narrative_code" type="String" nullable="true" length="15"/>
<column name="color_code" type="String" nullable="true" length="15"/> <column name="color_code" type="String" nullable="true" length="200"/>
<column name="factor_number" type="Long" length="11" nullable="true"/> <column name="factor_number" type="Long" length="11" nullable="true"/>
<column name="level_number" type="Long" length="11" nullable="true"/> <column name="level_number" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="level_number" type="Long" nullable="true"/>
<column name="level_desc" type="String" nullable="true" length="30"/> <column name="level_desc" type="String" nullable="true" length="30"/>
<column name="level_notes" type="CLOB" nullable="true"/> <column name="level_notes" type="CLOB" nullable="true"/>
<column name="rpt_hdr" type="CLOB" nullable="true"/>
</NODE> </NODE>
</NODE></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="left_quest_number" type="Long" nullable="true"/>
<column name="left_quest" type="String" nullable="true" length="80"/> <column name="left_quest" type="String" nullable="true" length="80"/>
<column name="right_quest_number" type="Long" nullable="true"/> <column name="section_number" type="Long" length="11" nullable="true"/>
<column name="right_quest" type="String" nullable="true" length="80"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="quest_lin" indexName="idx_quest_lin_section_number" isUnique="false"><column name="section_number"/></NODE>
</NODE></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">quest_hdr</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="quest_hdr_desc" type="String" nullable="true" length="30"/>
<column name="quest_type_flag" type="String" nullable="true" length="200"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -8,7 +8,6 @@ CREATE TABLE answer ( ...@@ -8,7 +8,6 @@ CREATE TABLE answer (
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
quest_number numeric(12) NULL,
answer_number numeric(12) NULL, answer_number numeric(12) NULL,
candidate_id numeric(12) NULL, candidate_id numeric(12) NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
......
...@@ -8,7 +8,7 @@ CREATE TABLE factor_lin ( ...@@ -8,7 +8,7 @@ CREATE TABLE factor_lin (
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
reverse_score_flag varchar(15) NULL, reverse_score_flag char(1) NULL,
factor_number numeric(12) NULL, factor_number numeric(12) NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
); );
......
...@@ -11,7 +11,7 @@ CREATE TABLE level_factor ( ...@@ -11,7 +11,7 @@ CREATE TABLE level_factor (
from_score numeric(12) NULL, from_score numeric(12) NULL,
to_score numeric(12) NULL, to_score numeric(12) NULL,
narrative_code varchar(15) NULL, narrative_code varchar(15) NULL,
color_code varchar(15) NULL, color_code varchar(200) NULL,
factor_number numeric(12) NULL, factor_number numeric(12) NULL,
level_number numeric(12) NULL level_number numeric(12) NULL
); );
......
...@@ -8,9 +8,9 @@ CREATE TABLE level ( ...@@ -8,9 +8,9 @@ CREATE TABLE level (
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
level_number numeric(12) NULL,
level_desc varchar(30) NULL, level_desc varchar(30) NULL,
level_notes text NULL level_notes text NULL,
rpt_hdr text NULL
); );
......
...@@ -8,10 +8,8 @@ CREATE TABLE quest_lin ( ...@@ -8,10 +8,8 @@ CREATE TABLE quest_lin (
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
left_quest_number numeric(12) NULL,
left_quest varchar(80) NULL, left_quest varchar(80) NULL,
right_quest_number numeric(12) NULL, section_number numeric(12) NULL
right_quest varchar(80) NULL
); );
...@@ -23,4 +21,6 @@ ALTER TABLE quest_lin ADD ...@@ -23,4 +21,6 @@ ALTER TABLE quest_lin ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_quest_lin_section_number
ON quest_lin (section_number);
-- DROP TABLE quest_hdr;
CREATE TABLE quest_hdr (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
quest_hdr_desc varchar(30) NULL,
quest_type_flag varchar(200) NULL
);
ALTER TABLE quest_hdr ADD
CONSTRAINT PK_quest_hdr PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -9,7 +9,6 @@ CREATE TABLE answer ( ...@@ -9,7 +9,6 @@ CREATE TABLE answer (
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
quest_number number(12) NULL,
answer_number number(12) NULL, answer_number number(12) NULL,
candidate_id number(12) NULL, candidate_id number(12) NULL,
quest_number number(12) NULL quest_number number(12) NULL
......
...@@ -9,7 +9,7 @@ CREATE TABLE factor_lin ( ...@@ -9,7 +9,7 @@ CREATE TABLE factor_lin (
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
reverse_score_flag varchar2(15) NULL, reverse_score_flag char(1) NULL,
factor_number number(12) NULL, factor_number number(12) NULL,
quest_number number(12) NULL quest_number number(12) NULL
); );
......
...@@ -12,7 +12,7 @@ CREATE TABLE level_factor ( ...@@ -12,7 +12,7 @@ CREATE TABLE level_factor (
from_score number(12) NULL, from_score number(12) NULL,
to_score number(12) NULL, to_score number(12) NULL,
narrative_code varchar2(15) NULL, narrative_code varchar2(15) NULL,
color_code varchar2(15) NULL, color_code varchar2(200) NULL,
factor_number number(12) NULL, factor_number number(12) NULL,
level_number number(12) NULL level_number number(12) NULL
); );
......
...@@ -9,9 +9,9 @@ CREATE TABLE level ( ...@@ -9,9 +9,9 @@ CREATE TABLE level (
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
level_number number(12) NULL,
level_desc varchar2(30) NULL, level_desc varchar2(30) NULL,
level_notes clob NULL level_notes clob NULL,
rpt_hdr clob NULL
); );
......
...@@ -9,10 +9,8 @@ CREATE TABLE quest_lin ( ...@@ -9,10 +9,8 @@ CREATE TABLE quest_lin (
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
left_quest_number number(12) NULL,
left_quest varchar2(80) NULL, left_quest varchar2(80) NULL,
right_quest_number number(12) NULL, section_number number(12) NULL
right_quest varchar2(80) NULL
); );
...@@ -24,4 +22,6 @@ ALTER TABLE quest_lin ADD ...@@ -24,4 +22,6 @@ ALTER TABLE quest_lin ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_quest_lin_section_number
ON quest_lin (section_number);
-- DROP TABLE quest_hdr;
CREATE TABLE quest_hdr (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
quest_hdr_desc varchar2(30) NULL,
quest_type_flag varchar2(200) NULL
);
ALTER TABLE quest_hdr ADD
CONSTRAINT PK_quest_hdr PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -9,7 +9,6 @@ CREATE TABLE answer ( ...@@ -9,7 +9,6 @@ CREATE TABLE answer (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
quest_number numeric(12) NULL,
answer_number numeric(12) NULL, answer_number numeric(12) NULL,
candidate_id numeric(12) NULL, candidate_id numeric(12) NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
......
...@@ -9,7 +9,7 @@ CREATE TABLE factor_lin ( ...@@ -9,7 +9,7 @@ CREATE TABLE factor_lin (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
reverse_score_flag varchar(15) NULL, reverse_score_flag char(1) NULL,
factor_number numeric(12) NULL, factor_number numeric(12) NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
); );
......
...@@ -12,7 +12,7 @@ CREATE TABLE level_factor ( ...@@ -12,7 +12,7 @@ CREATE TABLE level_factor (
from_score numeric(12) NULL, from_score numeric(12) NULL,
to_score numeric(12) NULL, to_score numeric(12) NULL,
narrative_code varchar(15) NULL, narrative_code varchar(15) NULL,
color_code varchar(15) NULL, color_code varchar(200) NULL,
factor_number numeric(12) NULL, factor_number numeric(12) NULL,
level_number numeric(12) NULL level_number numeric(12) NULL
); );
......
...@@ -9,9 +9,9 @@ CREATE TABLE level ( ...@@ -9,9 +9,9 @@ CREATE TABLE level (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
level_number numeric(12) NULL,
level_desc varchar(30) NULL, level_desc varchar(30) NULL,
level_notes text NULL level_notes text NULL,
rpt_hdr text NULL
); );
......
...@@ -9,10 +9,8 @@ CREATE TABLE quest_lin ( ...@@ -9,10 +9,8 @@ CREATE TABLE quest_lin (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
left_quest_number numeric(12) NULL,
left_quest varchar(80) NULL, left_quest varchar(80) NULL,
right_quest_number numeric(12) NULL, section_number numeric(12) NULL
right_quest varchar(80) NULL
); );
...@@ -24,4 +22,6 @@ ALTER TABLE quest_lin ADD ...@@ -24,4 +22,6 @@ ALTER TABLE quest_lin ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_quest_lin_section_number
ON quest_lin (section_number);
-- @AutoRun
-- drop table quest_hdr;
CREATE TABLE quest_hdr (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
quest_hdr_desc varchar(30) NULL,
quest_type_flag varchar(200) NULL
);
ALTER TABLE quest_hdr ADD
CONSTRAINT pk_quest_hdr PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<TABLE name="answer" tablePrefix="object" polymorphic="FALSE"> <TABLE name="answer" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="QuestionNo" type="Integer" dbcol="quest_number"/>
<ATTRIB name="AnswerNo" type="Integer" dbcol="answer_number"/> <ATTRIB name="AnswerNo" type="Integer" dbcol="answer_number"/>
<!--<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" />--> <!--<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" />-->
......
...@@ -26,12 +26,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -26,12 +26,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
private static final LoggingArea AnswerPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Answer"); private static final LoggingArea AnswerPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Answer");
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private Integer dummyQuestionNo;
private Integer dummyAnswerNo; private Integer dummyAnswerNo;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_QuestionNo = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_AnswerNo = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_AnswerNo = DefaultAttributeHelper.INSTANCE;
...@@ -39,12 +37,11 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -39,12 +37,11 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
public AnswerPersistenceMgr () public AnswerPersistenceMgr ()
{ {
dummyQuestionNo = (Integer)(HELPER_QuestionNo.initialise (dummyQuestionNo));
dummyAnswerNo = (Integer)(HELPER_AnswerNo.initialise (dummyAnswerNo)); dummyAnswerNo = (Integer)(HELPER_AnswerNo.initialise (dummyAnswerNo));
} }
private String SELECT_COLUMNS = "{PREFIX}answer.object_id as id, {PREFIX}answer.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}answer.object_CREATED_DATE as CREATED_DATE, {PREFIX}answer.quest_number, {PREFIX}answer.answer_number, {PREFIX}answer.candidate_id, {PREFIX}answer.quest_number, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}answer.object_id as id, {PREFIX}answer.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}answer.object_CREATED_DATE as CREATED_DATE, {PREFIX}answer.answer_number, {PREFIX}answer.candidate_id, {PREFIX}answer.quest_number, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -95,7 +92,6 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -95,7 +92,6 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || !answerPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || if (false || !answerPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!answerPSet.containsAttrib(Answer.FIELD_QuestionNo)||
!answerPSet.containsAttrib(Answer.FIELD_AnswerNo)|| !answerPSet.containsAttrib(Answer.FIELD_AnswerNo)||
!answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Candidate)|| !answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Candidate)||
!answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Question)) !answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Question))
...@@ -168,10 +164,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -168,10 +164,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}answer " + "UPDATE {PREFIX}answer " +
"SET quest_number = ?, answer_number = ?, candidate_id = ? , quest_number = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET answer_number = ?, candidate_id = ? , quest_number = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE answer.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE answer.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_QuestionNo.getForSQL(dummyQuestionNo, answerPSet.getAttrib (Answer.FIELD_QuestionNo))).listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, answerPSet.getAttrib (Answer.FIELD_AnswerNo))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, answerPSet.getAttrib (Answer.FIELD_AnswerNo))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -385,7 +381,6 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -385,7 +381,6 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
// Object Created // Object Created
answerPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE")); answerPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
answerPSet.setAttrib(Answer.FIELD_QuestionNo, HELPER_QuestionNo.getFromRS(dummyQuestionNo, r, "quest_number"));
answerPSet.setAttrib(Answer.FIELD_AnswerNo, HELPER_AnswerNo.getFromRS(dummyAnswerNo, r, "answer_number")); answerPSet.setAttrib(Answer.FIELD_AnswerNo, HELPER_AnswerNo.getFromRS(dummyAnswerNo, r, "answer_number"));
answerPSet.setAttrib(Answer.SINGLEREFERENCE_Candidate, r.getObject ("candidate_id")); answerPSet.setAttrib(Answer.SINGLEREFERENCE_Candidate, r.getObject ("candidate_id"));
...@@ -406,10 +401,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr ...@@ -406,10 +401,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}answer " + "INSERT INTO {PREFIX}answer " +
" (quest_number, answer_number, candidate_id, quest_number, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (answer_number, candidate_id, quest_number, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_QuestionNo.getForSQL(dummyQuestionNo, answerPSet.getAttrib (Answer.FIELD_QuestionNo))).listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, answerPSet.getAttrib (Answer.FIELD_AnswerNo))) .listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, answerPSet.getAttrib (Answer.FIELD_AnswerNo))) .listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))) .listEntry (objectID.longID ()).toList().toArray());
answerPSet.setStatus (PersistentSetStatus.PROCESSED); answerPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -51,7 +51,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -51,7 +51,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String _ReverseScore; private Boolean _ReverseScore;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -131,9 +131,8 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -131,9 +131,8 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "reverse_score_flag"); metaInfo.put ("dbcol", "reverse_score_flag");
metaInfo.put ("length", "15");
metaInfo.put ("name", "ReverseScore"); metaInfo.put ("name", "ReverseScore");
metaInfo.put ("type", "String"); metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorQuestionLink.ReverseScore:", metaInfo); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorQuestionLink.ReverseScore:", metaInfo);
ATTRIBUTES_METADATA_FactorQuestionLink.put (FIELD_ReverseScore, Collections.unmodifiableMap (metaInfo)); ATTRIBUTES_METADATA_FactorQuestionLink.put (FIELD_ReverseScore, Collections.unmodifiableMap (metaInfo));
...@@ -171,7 +170,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -171,7 +170,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
super._initialiseNewObjAttributes (transaction); super._initialiseNewObjAttributes (transaction);
_ReverseScore = (String)(HELPER_ReverseScore.initialise (_ReverseScore)); _ReverseScore = (Boolean)(HELPER_ReverseScore.initialise (_ReverseScore));
} }
...@@ -203,10 +202,10 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -203,10 +202,10 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
/** /**
* Get the attribute ReverseScore * Get the attribute ReverseScore
*/ */
public String getReverseScore () public Boolean getReverseScore ()
{ {
assertValid(); assertValid();
String valToReturn = _ReverseScore; Boolean valToReturn = _ReverseScore;
for (FactorQuestionLinkBehaviourDecorator bhd : FactorQuestionLink_BehaviourDecorators) for (FactorQuestionLinkBehaviourDecorator bhd : FactorQuestionLink_BehaviourDecorators)
{ {
...@@ -222,7 +221,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -222,7 +221,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception * Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value. * is thrown, the attribute change will fail. The new value is different to the old value.
*/ */
protected void preReverseScoreChange (String newReverseScore) throws FieldException protected void preReverseScoreChange (Boolean newReverseScore) throws FieldException
{ {
} }
...@@ -246,7 +245,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -246,7 +245,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
* Set the attribute ReverseScore. Checks to ensure a new value * Set the attribute ReverseScore. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute. * has been supplied. If so, marks the field as altered and sets the attribute.
*/ */
public void setReverseScore (String newReverseScore) throws FieldException public void setReverseScore (Boolean newReverseScore) throws FieldException
{ {
boolean oldAndNewIdentical = HELPER_ReverseScore.compare (_ReverseScore, newReverseScore); boolean oldAndNewIdentical = HELPER_ReverseScore.compare (_ReverseScore, newReverseScore);
...@@ -801,7 +800,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -801,7 +800,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
PersistentSet factor_linPSet = allSets.getPersistentSet (objectID, "factor_lin"); PersistentSet factor_linPSet = allSets.getPersistentSet (objectID, "factor_lin");
_ReverseScore = (String)(HELPER_ReverseScore.fromObject (_ReverseScore, factor_linPSet.getAttrib (FIELD_ReverseScore))); // _ReverseScore = (Boolean)(HELPER_ReverseScore.fromObject (_ReverseScore, factor_linPSet.getAttrib (FIELD_ReverseScore))); //
_Factor.setFromPersistentSets (objectID, allSets); _Factor.setFromPersistentSets (objectID, allSets);
_Question.setFromPersistentSets (objectID, allSets); _Question.setFromPersistentSets (objectID, allSets);
...@@ -898,7 +897,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -898,7 +897,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
{ {
super.readExternalData(vals); super.readExternalData(vals);
_ReverseScore = (String)(HELPER_ReverseScore.readExternal (_ReverseScore, vals.get(FIELD_ReverseScore))); // _ReverseScore = (Boolean)(HELPER_ReverseScore.readExternal (_ReverseScore, vals.get(FIELD_ReverseScore))); //
_Factor.readExternalData(vals.get(SINGLEREFERENCE_Factor)); _Factor.readExternalData(vals.get(SINGLEREFERENCE_Factor));
_Question.readExternalData(vals.get(SINGLEREFERENCE_Question)); _Question.readExternalData(vals.get(SINGLEREFERENCE_Question));
...@@ -1043,7 +1042,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -1043,7 +1042,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
} }
public SearchAll andReverseScore (QueryFilter<String> filter) public SearchAll andReverseScore (QueryFilter<Boolean> filter)
{ {
filter.addFilter (context, "factor_lin.reverse_score_flag", "ReverseScore"); filter.addFilter (context, "factor_lin.reverse_score_flag", "ReverseScore");
return this; return this;
...@@ -1132,7 +1131,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -1132,7 +1131,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
} }
else if (attribName.equals (FIELD_ReverseScore)) else if (attribName.equals (FIELD_ReverseScore))
{ {
setReverseScore ((String)(HELPER_ReverseScore.fromObject (_ReverseScore, attribValue))); setReverseScore ((Boolean)(HELPER_ReverseScore.fromObject (_ReverseScore, attribValue)));
} }
else else
{ {
...@@ -1244,7 +1243,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -1244,7 +1243,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
/** /**
* Get the attribute ReverseScore * Get the attribute ReverseScore
*/ */
public String getReverseScore (FactorQuestionLink obj, String original) public Boolean getReverseScore (FactorQuestionLink obj, Boolean original)
{ {
return original; return original;
} }
...@@ -1254,7 +1253,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -1254,7 +1253,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
* May modify the field beforehand * May modify the field beforehand
* Occurs before validation. * Occurs before validation.
*/ */
public String setReverseScore (FactorQuestionLink obj, String newReverseScore) throws FieldException public Boolean setReverseScore (FactorQuestionLink obj, Boolean newReverseScore) throws FieldException
{ {
return newReverseScore; return newReverseScore;
} }
...@@ -1329,7 +1328,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass ...@@ -1329,7 +1328,7 @@ public abstract class BaseFactorQuestionLink extends BaseBusinessClass
} }
public PipeLine<From, String> toReverseScore () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ReverseScore)); } public PipeLine<From, Boolean> toReverseScore () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ReverseScore)); }
public Factor.FactorPipeLineFactory<From, Factor> toFactor () { return toFactor (Filter.ALL); } public Factor.FactorPipeLineFactory<From, Factor> toFactor () { return toFactor (Filter.ALL); }
public Factor.FactorPipeLineFactory<From, Factor> toFactor (Filter<Factor> filter) public Factor.FactorPipeLineFactory<From, Factor> toFactor (Filter<Factor> filter)
......
...@@ -26,6 +26,8 @@ import oneit.utils.filter.Filter; ...@@ -26,6 +26,8 @@ import oneit.utils.filter.Filter;
import oneit.utils.transform.*; import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseFactorScoreResult extends BaseBusinessClass public abstract class BaseFactorScoreResult extends BaseBusinessClass
...@@ -54,14 +56,14 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -54,14 +56,14 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
private static final DefaultAttributeHelper<FactorScoreResult> HELPER_FromScore = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<FactorScoreResult> HELPER_FromScore = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<FactorScoreResult> HELPER_ToScore = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<FactorScoreResult> HELPER_ToScore = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<FactorScoreResult> HELPER_NarrativeCode = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<FactorScoreResult> HELPER_NarrativeCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<FactorScoreResult> HELPER_ColorCode = DefaultAttributeHelper.INSTANCE; private static final EnumeratedAttributeHelper<FactorScoreResult, ColorCode> HELPER_ColorCode = new EnumeratedAttributeHelper<FactorScoreResult, ColorCode> (ColorCode.FACTORY_ColorCode);
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private Integer _FromScore; private Integer _FromScore;
private Integer _ToScore; private Integer _ToScore;
private String _NarrativeCode; private String _NarrativeCode;
private String _ColorCode; private ColorCode _ColorCode;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -201,10 +203,10 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -201,10 +203,10 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "color_code"); metaInfo.put ("dbcol", "color_code");
metaInfo.put ("length", "15");
metaInfo.put ("name", "ColorCode"); metaInfo.put ("name", "ColorCode");
metaInfo.put ("type", "String"); metaInfo.put ("type", "ColorCode");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorScoreResult.ColorCode:", metaInfo); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorScoreResult.ColorCode:", metaInfo);
ATTRIBUTES_METADATA_FactorScoreResult.put (FIELD_ColorCode, Collections.unmodifiableMap (metaInfo)); ATTRIBUTES_METADATA_FactorScoreResult.put (FIELD_ColorCode, Collections.unmodifiableMap (metaInfo));
...@@ -245,7 +247,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -245,7 +247,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
_FromScore = (Integer)(HELPER_FromScore.initialise (_FromScore)); _FromScore = (Integer)(HELPER_FromScore.initialise (_FromScore));
_ToScore = (Integer)(HELPER_ToScore.initialise (_ToScore)); _ToScore = (Integer)(HELPER_ToScore.initialise (_ToScore));
_NarrativeCode = (String)(HELPER_NarrativeCode.initialise (_NarrativeCode)); _NarrativeCode = (String)(HELPER_NarrativeCode.initialise (_NarrativeCode));
_ColorCode = (String)(HELPER_ColorCode.initialise (_ColorCode)); _ColorCode = (ColorCode)(HELPER_ColorCode.initialise (_ColorCode));
} }
...@@ -571,10 +573,10 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -571,10 +573,10 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
/** /**
* Get the attribute ColorCode * Get the attribute ColorCode
*/ */
public String getColorCode () public ColorCode getColorCode ()
{ {
assertValid(); assertValid();
String valToReturn = _ColorCode; ColorCode valToReturn = _ColorCode;
for (FactorScoreResultBehaviourDecorator bhd : FactorScoreResult_BehaviourDecorators) for (FactorScoreResultBehaviourDecorator bhd : FactorScoreResult_BehaviourDecorators)
{ {
...@@ -590,7 +592,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -590,7 +592,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception * Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value. * is thrown, the attribute change will fail. The new value is different to the old value.
*/ */
protected void preColorCodeChange (String newColorCode) throws FieldException protected void preColorCodeChange (ColorCode newColorCode) throws FieldException
{ {
} }
...@@ -614,7 +616,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -614,7 +616,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
* Set the attribute ColorCode. Checks to ensure a new value * Set the attribute ColorCode. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute. * has been supplied. If so, marks the field as altered and sets the attribute.
*/ */
public void setColorCode (String newColorCode) throws FieldException public void setColorCode (ColorCode newColorCode) throws FieldException
{ {
boolean oldAndNewIdentical = HELPER_ColorCode.compare (_ColorCode, newColorCode); boolean oldAndNewIdentical = HELPER_ColorCode.compare (_ColorCode, newColorCode);
...@@ -1175,7 +1177,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1175,7 +1177,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
_FromScore = (Integer)(HELPER_FromScore.fromObject (_FromScore, level_factorPSet.getAttrib (FIELD_FromScore))); // _FromScore = (Integer)(HELPER_FromScore.fromObject (_FromScore, level_factorPSet.getAttrib (FIELD_FromScore))); //
_ToScore = (Integer)(HELPER_ToScore.fromObject (_ToScore, level_factorPSet.getAttrib (FIELD_ToScore))); // _ToScore = (Integer)(HELPER_ToScore.fromObject (_ToScore, level_factorPSet.getAttrib (FIELD_ToScore))); //
_NarrativeCode = (String)(HELPER_NarrativeCode.fromObject (_NarrativeCode, level_factorPSet.getAttrib (FIELD_NarrativeCode))); // _NarrativeCode = (String)(HELPER_NarrativeCode.fromObject (_NarrativeCode, level_factorPSet.getAttrib (FIELD_NarrativeCode))); //
_ColorCode = (String)(HELPER_ColorCode.fromObject (_ColorCode, level_factorPSet.getAttrib (FIELD_ColorCode))); // _ColorCode = (ColorCode)(HELPER_ColorCode.fromObject (_ColorCode, level_factorPSet.getAttrib (FIELD_ColorCode))); //
_Factor.setFromPersistentSets (objectID, allSets); _Factor.setFromPersistentSets (objectID, allSets);
_Level.setFromPersistentSets (objectID, allSets); _Level.setFromPersistentSets (objectID, allSets);
...@@ -1305,7 +1307,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1305,7 +1307,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
_FromScore = (Integer)(HELPER_FromScore.readExternal (_FromScore, vals.get(FIELD_FromScore))); // _FromScore = (Integer)(HELPER_FromScore.readExternal (_FromScore, vals.get(FIELD_FromScore))); //
_ToScore = (Integer)(HELPER_ToScore.readExternal (_ToScore, vals.get(FIELD_ToScore))); // _ToScore = (Integer)(HELPER_ToScore.readExternal (_ToScore, vals.get(FIELD_ToScore))); //
_NarrativeCode = (String)(HELPER_NarrativeCode.readExternal (_NarrativeCode, vals.get(FIELD_NarrativeCode))); // _NarrativeCode = (String)(HELPER_NarrativeCode.readExternal (_NarrativeCode, vals.get(FIELD_NarrativeCode))); //
_ColorCode = (String)(HELPER_ColorCode.readExternal (_ColorCode, vals.get(FIELD_ColorCode))); // _ColorCode = (ColorCode)(HELPER_ColorCode.readExternal (_ColorCode, vals.get(FIELD_ColorCode))); //
_Factor.readExternalData(vals.get(SINGLEREFERENCE_Factor)); _Factor.readExternalData(vals.get(SINGLEREFERENCE_Factor));
_Level.readExternalData(vals.get(SINGLEREFERENCE_Level)); _Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
...@@ -1498,7 +1500,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1498,7 +1500,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
return this; return this;
} }
public SearchAll andColorCode (QueryFilter<String> filter) public SearchAll andColorCode (QueryFilter<ColorCode> filter)
{ {
filter.addFilter (context, "level_factor.color_code", "ColorCode"); filter.addFilter (context, "level_factor.color_code", "ColorCode");
return this; return this;
...@@ -1585,7 +1587,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1585,7 +1587,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
return this; return this;
} }
public SearchFactorScore andColorCode (QueryFilter<String> filter) public SearchFactorScore andColorCode (QueryFilter<ColorCode> filter)
{ {
filter.addFilter (context, "level_factor.color_code", "ColorCode"); filter.addFilter (context, "level_factor.color_code", "ColorCode");
return this; return this;
...@@ -1708,7 +1710,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1708,7 +1710,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
} }
else if (attribName.equals (FIELD_ColorCode)) else if (attribName.equals (FIELD_ColorCode))
{ {
setColorCode ((String)(HELPER_ColorCode.fromObject (_ColorCode, attribValue))); setColorCode ((ColorCode)(HELPER_ColorCode.fromObject (_ColorCode, attribValue)));
} }
else else
{ {
...@@ -1904,7 +1906,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1904,7 +1906,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
/** /**
* Get the attribute ColorCode * Get the attribute ColorCode
*/ */
public String getColorCode (FactorScoreResult obj, String original) public ColorCode getColorCode (FactorScoreResult obj, ColorCode original)
{ {
return original; return original;
} }
...@@ -1914,7 +1916,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -1914,7 +1916,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
* May modify the field beforehand * May modify the field beforehand
* Occurs before validation. * Occurs before validation.
*/ */
public String setColorCode (FactorScoreResult obj, String newColorCode) throws FieldException public ColorCode setColorCode (FactorScoreResult obj, ColorCode newColorCode) throws FieldException
{ {
return newColorCode; return newColorCode;
} }
...@@ -2007,7 +2009,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass ...@@ -2007,7 +2009,7 @@ public abstract class BaseFactorScoreResult extends BaseBusinessClass
public PipeLine<From, String> toNarrativeCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_NarrativeCode)); } public PipeLine<From, String> toNarrativeCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_NarrativeCode)); }
public PipeLine<From, String> toColorCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ColorCode)); } public PipeLine<From, ColorCode> toColorCode () { return pipe(new ORMAttributePipe<Me, ColorCode>(FIELD_ColorCode)); }
public Factor.FactorPipeLineFactory<From, Factor> toFactor () { return toFactor (Filter.ALL); } public Factor.FactorPipeLineFactory<From, Factor> toFactor () { return toFactor (Filter.ALL); }
public Factor.FactorPipeLineFactory<From, Factor> toFactor (Filter<Factor> filter) public Factor.FactorPipeLineFactory<From, Factor> toFactor (Filter<Factor> filter)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<TABLE name="factor_lin" tablePrefix="object" polymorphic="FALSE"> <TABLE name="factor_lin" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="ReverseScore" type="String" dbcol="reverse_score_flag" length="15"/> <ATTRIB name="ReverseScore" type="Boolean" dbcol="reverse_score_flag"/>
<SINGLEREFERENCE name="Factor" type="Factor" dbcol="factor_number" /> <SINGLEREFERENCE name="Factor" type="Factor" dbcol="factor_number" />
<SINGLEREFERENCE name="Question" type="Question" dbcol="quest_number" /> <SINGLEREFERENCE name="Question" type="Question" dbcol="quest_number" />
......
...@@ -26,7 +26,7 @@ public class FactorQuestionLinkPersistenceMgr extends ObjectPersistenceMgr ...@@ -26,7 +26,7 @@ public class FactorQuestionLinkPersistenceMgr extends ObjectPersistenceMgr
private static final LoggingArea FactorQuestionLinkPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "FactorQuestionLink"); private static final LoggingArea FactorQuestionLinkPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "FactorQuestionLink");
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String dummyReverseScore; private Boolean dummyReverseScore;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -37,7 +37,7 @@ public class FactorQuestionLinkPersistenceMgr extends ObjectPersistenceMgr ...@@ -37,7 +37,7 @@ public class FactorQuestionLinkPersistenceMgr extends ObjectPersistenceMgr
public FactorQuestionLinkPersistenceMgr () public FactorQuestionLinkPersistenceMgr ()
{ {
dummyReverseScore = (String)(HELPER_ReverseScore.initialise (dummyReverseScore)); dummyReverseScore = (Boolean)(HELPER_ReverseScore.initialise (dummyReverseScore));
} }
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'> <ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="FactorScoreResult" package="performa.orm"> <BUSINESSCLASS name="FactorScoreResult" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="level_factor" tablePrefix="object" polymorphic="FALSE"> <TABLE name="level_factor" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="FromScore" type="Integer" dbcol="from_score"/> <ATTRIB name="FromScore" type="Integer" dbcol="from_score"/>
<ATTRIB name="ToScore" type="Integer" dbcol="to_score"/> <ATTRIB name="ToScore" type="Integer" dbcol="to_score"/>
<ATTRIB name="NarrativeCode" type="String" dbcol="narrative_code" length="15"/> <ATTRIB name="NarrativeCode" type="String" dbcol="narrative_code" length="15"/>
<ATTRIB name="ColorCode" type="String" dbcol="color_code" length="15"/> <ATTRIB name="ColorCode" type="ColorCode" dbcol="color_code" attribHelper="EnumeratedAttributeHelper" />
<SINGLEREFERENCE name="Factor" type="Factor" dbcol="factor_number" /> <SINGLEREFERENCE name="Factor" type="Factor" dbcol="factor_number" />
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_number" /> <SINGLEREFERENCE name="Level" type="Level" dbcol="level_number" />
......
...@@ -14,6 +14,7 @@ import oneit.sql.*; ...@@ -14,6 +14,7 @@ import oneit.sql.*;
import oneit.utils.resource.*; import oneit.utils.resource.*;
import oneit.utils.*; import oneit.utils.*;
import oneit.utils.threading.*; import oneit.utils.threading.*;
import performa.orm.types.*;
...@@ -29,14 +30,14 @@ public class FactorScoreResultPersistenceMgr extends ObjectPersistenceMgr ...@@ -29,14 +30,14 @@ public class FactorScoreResultPersistenceMgr extends ObjectPersistenceMgr
private Integer dummyFromScore; private Integer dummyFromScore;
private Integer dummyToScore; private Integer dummyToScore;
private String dummyNarrativeCode; private String dummyNarrativeCode;
private String dummyColorCode; private ColorCode dummyColorCode;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_FromScore = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_FromScore = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ToScore = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_ToScore = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_NarrativeCode = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_NarrativeCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ColorCode = DefaultAttributeHelper.INSTANCE; private static final EnumeratedAttributeHelper HELPER_ColorCode = new EnumeratedAttributeHelper (ColorCode.FACTORY_ColorCode);
...@@ -46,7 +47,7 @@ public class FactorScoreResultPersistenceMgr extends ObjectPersistenceMgr ...@@ -46,7 +47,7 @@ public class FactorScoreResultPersistenceMgr extends ObjectPersistenceMgr
dummyFromScore = (Integer)(HELPER_FromScore.initialise (dummyFromScore)); dummyFromScore = (Integer)(HELPER_FromScore.initialise (dummyFromScore));
dummyToScore = (Integer)(HELPER_ToScore.initialise (dummyToScore)); dummyToScore = (Integer)(HELPER_ToScore.initialise (dummyToScore));
dummyNarrativeCode = (String)(HELPER_NarrativeCode.initialise (dummyNarrativeCode)); dummyNarrativeCode = (String)(HELPER_NarrativeCode.initialise (dummyNarrativeCode));
dummyColorCode = (String)(HELPER_ColorCode.initialise (dummyColorCode)); dummyColorCode = (ColorCode)(HELPER_ColorCode.initialise (dummyColorCode));
} }
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<TABLE name="level" tablePrefix="object" polymorphic="FALSE"> <TABLE name="level" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="LevelNo" type="Integer" dbcol="level_number"/>
<ATTRIB name="LevelDescription" type="String" dbcol="level_desc" length="30"/> <ATTRIB name="LevelDescription" type="String" dbcol="level_desc" length="30"/>
<ATTRIB name="LevelNotes" type="String" dbcol="level_notes"/> <ATTRIB name="LevelNotes" type="String" dbcol="level_notes"/>
<ATTRIB name="ReportHeader" type="String" dbcol="rpt_hdr"/>
</TABLE> </TABLE>
......
...@@ -26,28 +26,28 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr ...@@ -26,28 +26,28 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
private static final LoggingArea LevelPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Level"); private static final LoggingArea LevelPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Level");
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private Integer dummyLevelNo;
private String dummyLevelDescription; private String dummyLevelDescription;
private String dummyLevelNotes; private String dummyLevelNotes;
private String dummyReportHeader;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_LevelNo = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LevelDescription = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_LevelDescription = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LevelNotes = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_LevelNotes = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ReportHeader = DefaultAttributeHelper.INSTANCE;
public LevelPersistenceMgr () public LevelPersistenceMgr ()
{ {
dummyLevelNo = (Integer)(HELPER_LevelNo.initialise (dummyLevelNo));
dummyLevelDescription = (String)(HELPER_LevelDescription.initialise (dummyLevelDescription)); dummyLevelDescription = (String)(HELPER_LevelDescription.initialise (dummyLevelDescription));
dummyLevelNotes = (String)(HELPER_LevelNotes.initialise (dummyLevelNotes)); dummyLevelNotes = (String)(HELPER_LevelNotes.initialise (dummyLevelNotes));
dummyReportHeader = (String)(HELPER_ReportHeader.initialise (dummyReportHeader));
} }
private String SELECT_COLUMNS = "{PREFIX}level.object_id as id, {PREFIX}level.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}level.object_CREATED_DATE as CREATED_DATE, {PREFIX}level.level_number, {PREFIX}level.level_desc, {PREFIX}level.level_notes, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}level.object_id as id, {PREFIX}level.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}level.object_CREATED_DATE as CREATED_DATE, {PREFIX}level.level_desc, {PREFIX}level.level_notes, {PREFIX}level.rpt_hdr, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -98,9 +98,9 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr ...@@ -98,9 +98,9 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || !levelPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || if (false || !levelPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!levelPSet.containsAttrib(Level.FIELD_LevelNo)||
!levelPSet.containsAttrib(Level.FIELD_LevelDescription)|| !levelPSet.containsAttrib(Level.FIELD_LevelDescription)||
!levelPSet.containsAttrib(Level.FIELD_LevelNotes)) !levelPSet.containsAttrib(Level.FIELD_LevelNotes)||
!levelPSet.containsAttrib(Level.FIELD_ReportHeader))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -170,10 +170,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr ...@@ -170,10 +170,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}level " + "UPDATE {PREFIX}level " +
"SET level_number = ?, level_desc = ?, level_notes = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET level_desc = ?, level_notes = ?, rpt_hdr = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE level.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE level.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_LevelNo.getForSQL(dummyLevelNo, levelPSet.getAttrib (Level.FIELD_LevelNo))).listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, levelPSet.getAttrib (Level.FIELD_ReportHeader))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -387,9 +387,9 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr ...@@ -387,9 +387,9 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
// Object Created // Object Created
levelPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE")); levelPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
levelPSet.setAttrib(Level.FIELD_LevelNo, HELPER_LevelNo.getFromRS(dummyLevelNo, r, "level_number"));
levelPSet.setAttrib(Level.FIELD_LevelDescription, HELPER_LevelDescription.getFromRS(dummyLevelDescription, r, "level_desc")); levelPSet.setAttrib(Level.FIELD_LevelDescription, HELPER_LevelDescription.getFromRS(dummyLevelDescription, r, "level_desc"));
levelPSet.setAttrib(Level.FIELD_LevelNotes, HELPER_LevelNotes.getFromRS(dummyLevelNotes, r, "level_notes")); levelPSet.setAttrib(Level.FIELD_LevelNotes, HELPER_LevelNotes.getFromRS(dummyLevelNotes, r, "level_notes"));
levelPSet.setAttrib(Level.FIELD_ReportHeader, HELPER_ReportHeader.getFromRS(dummyReportHeader, r, "rpt_hdr"));
} }
...@@ -407,10 +407,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr ...@@ -407,10 +407,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}level " + "INSERT INTO {PREFIX}level " +
" (level_number, level_desc, level_notes, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (level_desc, level_notes, rpt_hdr, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_LevelNo.getForSQL(dummyLevelNo, levelPSet.getAttrib (Level.FIELD_LevelNo))).listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, levelPSet.getAttrib (Level.FIELD_LevelNotes))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, levelPSet.getAttrib (Level.FIELD_ReportHeader))) .listEntry (objectID.longID ()).toList().toArray());
levelPSet.setStatus (PersistentSetStatus.PROCESSED); levelPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
<TABLE name="quest_lin" tablePrefix="object" polymorphic="FALSE"> <TABLE name="quest_lin" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="LeftQuestionNo" type="Integer" dbcol="left_quest_number"/> <ATTRIB name="Description" type="String" dbcol="left_quest" length="80"/>
<ATTRIB name="LeftQuestion" type="String" dbcol="left_quest" length="80"/>
<ATTRIB name="RightQuestionNo" type="Integer" dbcol="right_quest_number"/>
<ATTRIB name="RightQuestion" type="String" dbcol="right_quest" length="80"/>
<!--<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" />--> <SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" backreferenceName="Questions"/>
</TABLE> </TABLE>
......
...@@ -26,31 +26,22 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -26,31 +26,22 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
private static final LoggingArea QuestionPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Question"); private static final LoggingArea QuestionPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Question");
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private Integer dummyLeftQuestionNo; private String dummyDescription;
private String dummyLeftQuestion;
private Integer dummyRightQuestionNo;
private String dummyRightQuestion;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_LeftQuestionNo = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LeftQuestion = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_RightQuestionNo = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_RightQuestion = DefaultAttributeHelper.INSTANCE;
public QuestionPersistenceMgr () public QuestionPersistenceMgr ()
{ {
dummyLeftQuestionNo = (Integer)(HELPER_LeftQuestionNo.initialise (dummyLeftQuestionNo)); dummyDescription = (String)(HELPER_Description.initialise (dummyDescription));
dummyLeftQuestion = (String)(HELPER_LeftQuestion.initialise (dummyLeftQuestion));
dummyRightQuestionNo = (Integer)(HELPER_RightQuestionNo.initialise (dummyRightQuestionNo));
dummyRightQuestion = (String)(HELPER_RightQuestion.initialise (dummyRightQuestion));
} }
private String SELECT_COLUMNS = "{PREFIX}quest_lin.object_id as id, {PREFIX}quest_lin.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}quest_lin.object_CREATED_DATE as CREATED_DATE, {PREFIX}quest_lin.left_quest_number, {PREFIX}quest_lin.left_quest, {PREFIX}quest_lin.right_quest_number, {PREFIX}quest_lin.right_quest, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}quest_lin.object_id as id, {PREFIX}quest_lin.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}quest_lin.object_CREATED_DATE as CREATED_DATE, {PREFIX}quest_lin.left_quest, {PREFIX}quest_lin.section_number, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -101,10 +92,8 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -101,10 +92,8 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || !quest_linPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || if (false || !quest_linPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!quest_linPSet.containsAttrib(Question.FIELD_LeftQuestionNo)|| !quest_linPSet.containsAttrib(Question.FIELD_Description)||
!quest_linPSet.containsAttrib(Question.FIELD_LeftQuestion)|| !quest_linPSet.containsAttrib(Question.SINGLEREFERENCE_Section))
!quest_linPSet.containsAttrib(Question.FIELD_RightQuestionNo)||
!quest_linPSet.containsAttrib(Question.FIELD_RightQuestion))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -150,6 +139,16 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -150,6 +139,16 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{ {
throw new RuntimeException (); throw new RuntimeException ();
} }
else if (refName.equals (Question.SINGLEREFERENCE_Section))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}quest_lin " +
"WHERE " + SELECT_JOINS + "section_number = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else else
{ {
throw new IllegalArgumentException ("Illegal reference type:" + refName); throw new IllegalArgumentException ("Illegal reference type:" + refName);
...@@ -174,10 +173,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -174,10 +173,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}quest_lin " + "UPDATE {PREFIX}quest_lin " +
"SET left_quest_number = ?, left_quest = ?, right_quest_number = ?, right_quest = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET left_quest = ?, section_number = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE quest_lin.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE quest_lin.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_LeftQuestionNo.getForSQL(dummyLeftQuestionNo, quest_linPSet.getAttrib (Question.FIELD_LeftQuestionNo))).listEntry (HELPER_LeftQuestion.getForSQL(dummyLeftQuestion, quest_linPSet.getAttrib (Question.FIELD_LeftQuestion))).listEntry (HELPER_RightQuestionNo.getForSQL(dummyRightQuestionNo, quest_linPSet.getAttrib (Question.FIELD_RightQuestionNo))).listEntry (HELPER_RightQuestion.getForSQL(dummyRightQuestion, quest_linPSet.getAttrib (Question.FIELD_RightQuestion))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, quest_linPSet.getAttrib (Question.FIELD_Description))).listEntry (SQLManager.CheckNull((Long)(quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -391,11 +390,9 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -391,11 +390,9 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
// Object Created // Object Created
quest_linPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE")); quest_linPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
quest_linPSet.setAttrib(Question.FIELD_LeftQuestionNo, HELPER_LeftQuestionNo.getFromRS(dummyLeftQuestionNo, r, "left_quest_number")); quest_linPSet.setAttrib(Question.FIELD_Description, HELPER_Description.getFromRS(dummyDescription, r, "left_quest"));
quest_linPSet.setAttrib(Question.FIELD_LeftQuestion, HELPER_LeftQuestion.getFromRS(dummyLeftQuestion, r, "left_quest"));
quest_linPSet.setAttrib(Question.FIELD_RightQuestionNo, HELPER_RightQuestionNo.getFromRS(dummyRightQuestionNo, r, "right_quest_number"));
quest_linPSet.setAttrib(Question.FIELD_RightQuestion, HELPER_RightQuestion.getFromRS(dummyRightQuestion, r, "right_quest"));
quest_linPSet.setAttrib(Question.SINGLEREFERENCE_Section, r.getObject ("section_number"));
} }
...@@ -412,10 +409,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr ...@@ -412,10 +409,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}quest_lin " + "INSERT INTO {PREFIX}quest_lin " +
" (left_quest_number, left_quest, right_quest_number, right_quest, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (left_quest, section_number, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_LeftQuestionNo.getForSQL(dummyLeftQuestionNo, quest_linPSet.getAttrib (Question.FIELD_LeftQuestionNo))).listEntry (HELPER_LeftQuestion.getForSQL(dummyLeftQuestion, quest_linPSet.getAttrib (Question.FIELD_LeftQuestion))).listEntry (HELPER_RightQuestionNo.getForSQL(dummyRightQuestionNo, quest_linPSet.getAttrib (Question.FIELD_RightQuestionNo))).listEntry (HELPER_RightQuestion.getForSQL(dummyRightQuestion, quest_linPSet.getAttrib (Question.FIELD_RightQuestion))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, quest_linPSet.getAttrib (Question.FIELD_Description))) .listEntry (SQLManager.CheckNull((Long)(quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))) .listEntry (objectID.longID ()).toList().toArray());
quest_linPSet.setStatus (PersistentSetStatus.PROCESSED); quest_linPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
package performa.orm;
public class Section extends BaseSection
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public Section ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="Section" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="Questions" type="Question" backreferenceName="Section" />
<TABLE name="quest_hdr" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Description" type="String" dbcol="quest_hdr_desc" length="30"/>
<ATTRIB name="QuestionType" type="QuestionType" dbcol="quest_type_flag" attribHelper="EnumeratedAttributeHelper" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class ColorCode extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_ColorCode = new ColorCodeFactory();
public static final ColorCode RED = new ColorCode ("RED", "RED", "Red", false);
public static final ColorCode AMBER = new ColorCode ("AMBER", "AMBER", "Amber", false);
public static final ColorCode GREEN = new ColorCode ("GREEN", "GREEN", "Green", false);
private static final ColorCode[] allColorCodes =
new ColorCode[] { RED,AMBER,GREEN};
private static ColorCode[] getAllColorCodes ()
{
return allColorCodes;
}
private transient Integer Weightage;
private ColorCode (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public Integer getWeightage()
{
return Weightage;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allColorCodes);
static
{
defineAdditionalData ();
}
public boolean isEqual (ColorCode other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return ColorCode.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return ColorCode.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_ColorCode;
}
public static ColorCode forName (String name)
{
if (name == null) { return null; }
ColorCode[] all = getAllColorCodes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static ColorCode forValue (String value)
{
if (value == null) { return null; }
ColorCode[] all = getAllColorCodes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllColorCodes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllColorCodes());
}
public static ColorCode[] getColorCodeArray ()
{
return (ColorCode[])getAllColorCodes().clone ();
}
public static void defineAdditionalData ()
{
RED.Weightage = 1;
AMBER.Weightage = 5;
GREEN.Weightage = 10;
}
static class ColorCodeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return ColorCode.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return ColorCode.forValue (name);
}
public Enumeration getAll ()
{
return ColorCode.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("Weightage", ArrayFormatter.toObject(getWeightage()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="ColorCode">
<DATA name="Weightage" type="Integer"/>
<VALUE name="RED" value="RED" description="Red" Weightage="1"/>
<VALUE name="AMBER" value="AMBER" description="Amber" Weightage="5"/>
<VALUE name="GREEN" value="GREEN" description="Green" Weightage="10"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class QuestionType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_QuestionType = new QuestionTypeFactory();
public static final QuestionType SCALAR = new QuestionType ("SCALAR", "SCALAR", "Scalar", false);
public static final QuestionType IPSATIVE = new QuestionType ("IPSATIVE", "IPSATIVE", "Ipsative", false);
private static final QuestionType[] allQuestionTypes =
new QuestionType[] { SCALAR,IPSATIVE};
private static QuestionType[] getAllQuestionTypes ()
{
return allQuestionTypes;
}
private QuestionType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allQuestionTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (QuestionType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return QuestionType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return QuestionType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_QuestionType;
}
public static QuestionType forName (String name)
{
if (name == null) { return null; }
QuestionType[] all = getAllQuestionTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static QuestionType forValue (String value)
{
if (value == null) { return null; }
QuestionType[] all = getAllQuestionTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllQuestionTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllQuestionTypes());
}
public static QuestionType[] getQuestionTypeArray ()
{
return (QuestionType[])getAllQuestionTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class QuestionTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return QuestionType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return QuestionType.forValue (name);
}
public Enumeration getAll ()
{
return QuestionType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="QuestionType">
<VALUE name="SCALAR" value="SCALAR" description="Scalar"/>
<VALUE name="IPSATIVE" value="IPSATIVE" description="Ipsative"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
package performa.form; package performa.utils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -74,20 +74,8 @@ public class AnalysisEngine ...@@ -74,20 +74,8 @@ public class AnalysisEngine
.andToScore(new LessThanEqualFilter<>(factorScore)) .andToScore(new LessThanEqualFilter<>(factorScore))
.search(objTran); .search(objTran);
int score = 0; int score = result.getColorCode().getWeightage();
switch (result.getColorCode())
{
case "Green":
score = 10;
break;
case "Amber":
score = 5;
break;
case "Red":
score = 1;
break;
}
// TODO: calculate normalised score based on importance // TODO: calculate normalised score based on importance
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment