Commit 74734ff8 by chenith Committed by Harsh Shah

Updated Answer BO with JobApplication. AnalysisEngine, TestInput and TestAnalysisFP updated.

parent 8c9043a8
......@@ -10,10 +10,10 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="answer_number" type="Long" nullable="true"/>
<column name="section_number" type="Long" length="11" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="quest_number" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_answer" indexName="idx_tl_answer_candidate_id" isUnique="false"><column name="candidate_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_answer" indexName="idx_tl_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -10,7 +10,7 @@ CREATE TABLE tl_answer (
,
answer_number numeric(12) NULL,
section_number numeric(12) NULL,
candidate_id numeric(12) NULL,
job_application_id numeric(12) NULL,
quest_number numeric(12) NULL
);
......@@ -24,5 +24,5 @@ ALTER TABLE tl_answer ADD
CREATE INDEX idx_tl_answer_candidate_id
ON tl_answer (candidate_id);
CREATE INDEX idx_tl_answer_job_application_id
ON tl_answer (job_application_id);
......@@ -11,7 +11,7 @@ CREATE TABLE tl_answer (
,
answer_number number(12) NULL,
section_number number(12) NULL,
candidate_id number(12) NULL,
job_application_id number(12) NULL,
quest_number number(12) NULL
);
......@@ -25,5 +25,5 @@ ALTER TABLE tl_answer ADD
CREATE INDEX idx_tl_answer_candidate_id
ON tl_answer (candidate_id);
CREATE INDEX idx_tl_answer_job_application_id
ON tl_answer (job_application_id);
......@@ -11,7 +11,7 @@ CREATE TABLE tl_answer (
,
answer_number numeric(12) NULL,
section_number numeric(12) NULL,
candidate_id numeric(12) NULL,
job_application_id numeric(12) NULL,
quest_number numeric(12) NULL
);
......@@ -25,5 +25,5 @@ ALTER TABLE tl_answer ADD
CREATE INDEX idx_tl_answer_candidate_id
ON tl_answer (candidate_id);
CREATE INDEX idx_tl_answer_job_application_id
ON tl_answer (job_application_id);
......@@ -169,7 +169,8 @@ public class TestAnalysisFP extends ORMProcessFormProcessor
answer.setAnswerNo(Integer.parseInt(values[i]));
answer.setQuestion(question);
testInput.getCandidatesAt(i -1).addToAnswers(answer);
//TODO: UPDATED - MOVE ANSWER FROM CANDIDATE TO JOB_APPLICATION
//testInput.getCandidatesAt(i -1).addToAnswers(answer);
}
}
}
......
......@@ -9,7 +9,7 @@
<ATTRIB name="AnswerNo" type="Integer" dbcol="answer_number"/>
<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" />
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="Answers"/>
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="ProfileAssessmentAnswers"/>
<SINGLEREFERENCE name="Question" type="Question" dbcol="quest_number" />
</TABLE>
......
......@@ -41,7 +41,7 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
}
private String SELECT_COLUMNS = "{PREFIX}tl_answer.object_id as id, {PREFIX}tl_answer.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_answer.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_answer.answer_number, {PREFIX}tl_answer.section_number, {PREFIX}tl_answer.candidate_id, {PREFIX}tl_answer.quest_number, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_answer.object_id as id, {PREFIX}tl_answer.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_answer.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_answer.answer_number, {PREFIX}tl_answer.section_number, {PREFIX}tl_answer.job_application_id, {PREFIX}tl_answer.quest_number, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -94,7 +94,7 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
if (false || !tl_answerPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_answerPSet.containsAttrib(Answer.FIELD_AnswerNo)||
!tl_answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Section)||
!tl_answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Candidate)||
!tl_answerPSet.containsAttrib(Answer.SINGLEREFERENCE_JobApplication)||
!tl_answerPSet.containsAttrib(Answer.SINGLEREFERENCE_Question))
{
// We will need to retrieve it
......@@ -141,11 +141,11 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
{
throw new RuntimeException ();
}
else if (refName.equals (Answer.SINGLEREFERENCE_Candidate))
else if (refName.equals (Answer.SINGLEREFERENCE_JobApplication))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_answer " +
"WHERE " + SELECT_JOINS + "candidate_id = ?";
"WHERE " + SELECT_JOINS + "job_application_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
......@@ -175,10 +175,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_answer " +
"SET answer_number = ?, section_number = ? , candidate_id = ? , quest_number = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET answer_number = ?, section_number = ? , job_application_id = ? , quest_number = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_answer.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, tl_answerPSet.getAttrib (Answer.FIELD_AnswerNo))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, tl_answerPSet.getAttrib (Answer.FIELD_AnswerNo))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_JobApplication)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -437,7 +437,7 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
tl_answerPSet.setAttrib(Answer.FIELD_AnswerNo, HELPER_AnswerNo.getFromRS(dummyAnswerNo, r, "answer_number"));
tl_answerPSet.setAttrib(Answer.SINGLEREFERENCE_Section, r.getObject ("section_number"));
tl_answerPSet.setAttrib(Answer.SINGLEREFERENCE_Candidate, r.getObject ("candidate_id"));
tl_answerPSet.setAttrib(Answer.SINGLEREFERENCE_JobApplication, r.getObject ("job_application_id"));
tl_answerPSet.setAttrib(Answer.SINGLEREFERENCE_Question, r.getObject ("quest_number"));
}
......@@ -455,10 +455,10 @@ public class AnswerPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_answer " +
" (answer_number, section_number, candidate_id, quest_number, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (answer_number, section_number, job_application_id, quest_number, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, tl_answerPSet.getAttrib (Answer.FIELD_AnswerNo))) .listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))) .listEntry (objectID.longID ()).toList().toArray());
CollectionUtils.listEntry (HELPER_AnswerNo.getForSQL(dummyAnswerNo, tl_answerPSet.getAttrib (Answer.FIELD_AnswerNo))) .listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_JobApplication)))).listEntry (SQLManager.CheckNull((Long)(tl_answerPSet.getAttrib (Answer.SINGLEREFERENCE_Question)))) .listEntry (objectID.longID ()).toList().toArray());
tl_answerPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -7,7 +7,6 @@
<IMPORT value="oneit.security.*" />
<MULTIPLEREFERENCE name="TestAnalysises" type="TestAnalysis" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="Answers" type="Answer" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="JobApplications" type="JobApplication" backreferenceName="Candidate" />
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
......
package performa.orm;
import java.util.Collection;
import java.util.Comparator;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.utils.ObjstoreUtils;
import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException;
......@@ -89,4 +93,13 @@ public class JobApplication extends BaseJobApplication
return Boolean.FALSE;
}
public Collection<Question> getFactorQuestions()
{
Filter filter = Question.SearchByAll().andIsRightQuestion(new EqualsFilter<>(Boolean.FALSE));
return ObjstoreUtils.sort(this.pipelineJobApplication().toJob().toLevel().toFactors().toFactor().toQuestions().toQuestion(filter).vals(),
new ObjectTransform[] {Question.pipesQuestion().toSection().toDescription()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR});
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
<MULTIPLEREFERENCE name="AssessmentCriteriaAnswers" type="AssessmentCriteriaAnswer" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="CultureCriteriaAnswers" type="CultureCriteriaAnswer" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="ProfileAssessmentAnswers" type="Answer" backreferenceName="JobApplication" />
<TABLE name="tl_job_application" tablePrefix="object" polymorphic="FALSE">
......
......@@ -23,7 +23,7 @@ public class TestInput extends BaseTestInput
Set<Factor> levelFactors = pipelineTestInput().toLevel().toFactors().toFactor().uniqueVals();
Filter<FactorQuestionLink> factorFilter = FactorQuestionLink.SearchByAll().andFactor(new InFilter(levelFactors));
return ObjstoreUtils.sort(pipelineTestInput().toCandidates().toAnswers().toQuestion().toFactors(factorFilter).toFactor().uniqueVals(),
return ObjstoreUtils.sort(pipelineTestInput().toCandidates().toJobApplications().toProfileAssessmentAnswers().toQuestion().toFactors(factorFilter).toFactor().uniqueVals(),
new ObjectTransform[]{Factor.pipesFactor().toDescription()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR});
}
......
......@@ -24,8 +24,8 @@ public class AnalysisEngine
Filter<FactorQuestionLink> factorFilter = FactorQuestionLink.SearchByAll().andFactor(new InFilter(levelFactors));
//Preloading Data
testInput.pipelineTestInput().toCandidates().toAnswers().toQuestion().toSection().uniqueVals();
testInput.pipelineTestInput().toCandidates().toAnswers().toQuestion().toFactors().toFactor().uniqueVals();
testInput.pipelineTestInput().toCandidates().toJobApplications().toProfileAssessmentAnswers().toQuestion().toSection().uniqueVals();
testInput.pipelineTestInput().toCandidates().toJobApplications().toProfileAssessmentAnswers().toQuestion().toFactors().toFactor().uniqueVals();
Factor.pipesFactor(levelFactors).toResults().uniqueVals();
for (Candidate candidate : testInput.getCandidatesSet())
......@@ -34,7 +34,9 @@ public class AnalysisEngine
Map<Factor, Integer> factorScoreMap = new HashMap();
for (Answer answer : candidate.getAnswersSet())
for(JobApplication application: candidate.getJobApplicationsSet())
{
for (Answer answer : application.getProfileAssessmentAnswersSet())
{
Set<FactorQuestionLink> links = answer.pipelineAnswer().toQuestion().toFactors(factorFilter).uniqueVals();
......@@ -66,6 +68,7 @@ public class AnalysisEngine
factorScoreMap.put(factor, factorScore);
}
}
}
TestAnalysis testAnalysis = TestAnalysis.createTestAnalysis(objTran);
testInput.getLevel().addToTestAnalysises(testAnalysis);
......
......@@ -18,7 +18,7 @@
<div class="main-application-outline">
<div class="selection-aust-logo">
<img src="images/australia-post.png" />
<span>Australia Post Chief Executive Officer</span>
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
</div>
<div class="show-mobile-title">
<div class="mobile-title-page">Section 3 - Job Match Assessment</div>
......
<?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">tl_answer</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="answer_number" type="Long" nullable="true"/>
<column name="section_number" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="quest_number" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_answer" indexName="idx_tl_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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