Commit 99117632 by Harsh Shah

Mandatory field changes

parent 90732ea9
......@@ -8,10 +8,10 @@
<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="name" type="String" nullable="true" length="200"/>
<column name="importance" type="String" nullable="true" length="200"/>
<column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="name" type="String" nullable="false" length="200"/>
<column name="importance" type="String" nullable="false" length="200"/>
<column name="assessment_type" type="String" nullable="false" length="200"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_criteria" indexName="idx_tl_assessment_criteria_job_id" isUnique="false"><column name="job_id"/></NODE>
......
......@@ -8,10 +8,10 @@
<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" type="Boolean" nullable="true"/>
<column name="answer" type="Boolean" nullable="false"/>
<column name="notes" type="CLOB" nullable="true"/>
<column name="assessment_criteria_id" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="assessment_criteria_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_criteria_answer" indexName="idx_tl_assessment_criteria_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
......
......@@ -8,10 +8,10 @@
<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="importance" type="String" nullable="true" length="200"/>
<column name="culture_element_id" type="Long" length="11" nullable="true"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="importance" type="String" nullable="false" length="200"/>
<column name="culture_element_id" type="Long" length="11" nullable="false"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_criteria" indexName="idx_tl_culture_criteria_job_id" isUnique="false"><column name="job_id"/></NODE>
......
......@@ -8,9 +8,9 @@
<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="culture_criteria_id" type="Long" length="11" nullable="true"/>
<column name="selected_question_id" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="culture_criteria_id" type="Long" length="11" nullable="false"/>
<column name="selected_question_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_criteria_answer" indexName="idx_tl_culture_criteria_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
......
......@@ -8,13 +8,13 @@
<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="job_title" type="String" nullable="true" length="500"/>
<column name="job_description" type="CLOB" nullable="true"/>
<column name="job_status" type="String" nullable="true" length="200"/>
<column name="job_title" type="String" nullable="false" length="500"/>
<column name="job_description" type="CLOB" nullable="false"/>
<column name="job_status" type="String" nullable="false" length="200"/>
<column name="apply_by" type="Date" nullable="true"/>
<column name="include_assessment_criteria" type="Boolean" nullable="true"/>
<column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="job_link" type="String" nullable="true" length="100"/>
<column name="include_assessment_criteria" type="Boolean" nullable="false"/>
<column name="assessment_type" type="String" nullable="false" length="200"/>
<column name="random_key" type="String" nullable="true" length="10"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="secuser_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -8,9 +8,9 @@
<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="cv" type="BLOB" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="cv" type="BLOB" nullable="false"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job_application" indexName="idx_tl_job_application_candidate_id" isUnique="false"><column name="candidate_id"/></NODE>
......
......@@ -8,10 +8,10 @@ CREATE TABLE tl_assessment_criteria (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
name varchar(200) NULL,
importance varchar(200) NULL,
assessment_type varchar(200) NULL,
job_id numeric(12) NULL
name varchar(200) NOT NULL,
importance varchar(200) NOT NULL,
assessment_type varchar(200) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -8,10 +8,10 @@ CREATE TABLE tl_assessment_criteria_answer (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
answer char(1) NULL,
answer char(1) NOT NULL,
notes text NULL,
assessment_criteria_id numeric(12) NULL,
job_application_id numeric(12) NULL
assessment_criteria_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
......
......@@ -8,10 +8,10 @@ CREATE TABLE tl_culture_criteria (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
importance varchar(200) NULL,
culture_element_id numeric(12) NULL,
culture_element_rating_id numeric(12) NULL,
job_id numeric(12) NULL
importance varchar(200) NOT NULL,
culture_element_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -8,9 +8,9 @@ CREATE TABLE tl_culture_criteria_answer (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
culture_criteria_id numeric(12) NULL,
selected_question_id numeric(12) NULL,
job_application_id numeric(12) NULL
culture_criteria_id numeric(12) NOT NULL,
selected_question_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
......
......@@ -8,13 +8,13 @@ CREATE TABLE tl_job (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
job_title varchar(500) NULL,
job_description text NULL,
job_status varchar(200) NULL,
job_title varchar(500) NOT NULL,
job_description text NOT NULL,
job_status varchar(200) NOT NULL,
apply_by datetime NULL,
include_assessment_criteria char(1) NULL,
assessment_type varchar(200) NULL,
job_link varchar(100) NULL,
include_assessment_criteria char(1) NOT NULL,
assessment_type varchar(200) NOT NULL,
random_key varchar(10) NULL,
level_id numeric(12) NULL,
secuser_id numeric(12) NULL
);
......
......@@ -8,9 +8,9 @@ CREATE TABLE tl_job_application (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
cv image NULL,
candidate_id numeric(12) NULL,
job_id numeric(12) NULL
cv image NOT NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_assessment_criteria (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
name varchar2(200) NULL,
importance varchar2(200) NULL,
assessment_type varchar2(200) NULL,
job_id number(12) NULL
name varchar2(200) NOT NULL,
importance varchar2(200) NOT NULL,
assessment_type varchar2(200) NOT NULL,
job_id number(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_assessment_criteria_answer (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
answer char(1) NULL,
answer char(1) NOT NULL,
notes clob NULL,
assessment_criteria_id number(12) NULL,
job_application_id number(12) NULL
assessment_criteria_id number(12) NOT NULL,
job_application_id number(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_culture_criteria (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
importance varchar2(200) NULL,
culture_element_id number(12) NULL,
culture_element_rating_id number(12) NULL,
job_id number(12) NULL
importance varchar2(200) NOT NULL,
culture_element_id number(12) NOT NULL,
culture_element_rating_id number(12) NOT NULL,
job_id number(12) NOT NULL
);
......
......@@ -9,9 +9,9 @@ CREATE TABLE tl_culture_criteria_answer (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
culture_criteria_id number(12) NULL,
selected_question_id number(12) NULL,
job_application_id number(12) NULL
culture_criteria_id number(12) NOT NULL,
selected_question_id number(12) NOT NULL,
job_application_id number(12) NOT NULL
);
......
......@@ -9,13 +9,13 @@ CREATE TABLE tl_job (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
job_title varchar2(500) NULL,
job_description clob NULL,
job_status varchar2(200) NULL,
job_title varchar2(500) NOT NULL,
job_description clob NOT NULL,
job_status varchar2(200) NOT NULL,
apply_by date NULL,
include_assessment_criteria char(1) NULL,
assessment_type varchar2(200) NULL,
job_link varchar2(100) NULL,
include_assessment_criteria char(1) NOT NULL,
assessment_type varchar2(200) NOT NULL,
random_key varchar2(10) NULL,
level_id number(12) NULL,
secuser_id number(12) NULL
);
......
......@@ -9,9 +9,9 @@ CREATE TABLE tl_job_application (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
cv blob NULL,
candidate_id number(12) NULL,
job_id number(12) NULL
cv blob NOT NULL,
candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_assessment_criteria (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
name varchar(200) NULL,
importance varchar(200) NULL,
assessment_type varchar(200) NULL,
job_id numeric(12) NULL
name varchar(200) NOT NULL,
importance varchar(200) NOT NULL,
assessment_type varchar(200) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_assessment_criteria_answer (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
answer char(1) NULL,
answer char(1) NOT NULL,
notes text NULL,
assessment_criteria_id numeric(12) NULL,
job_application_id numeric(12) NULL
assessment_criteria_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_culture_criteria (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
importance varchar(200) NULL,
culture_element_id numeric(12) NULL,
culture_element_rating_id numeric(12) NULL,
job_id numeric(12) NULL
importance varchar(200) NOT NULL,
culture_element_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -9,9 +9,9 @@ CREATE TABLE tl_culture_criteria_answer (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
culture_criteria_id numeric(12) NULL,
selected_question_id numeric(12) NULL,
job_application_id numeric(12) NULL
culture_criteria_id numeric(12) NOT NULL,
selected_question_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
......
......@@ -9,13 +9,13 @@ CREATE TABLE tl_job (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
job_title varchar(500) NULL,
job_description text NULL,
job_status varchar(200) NULL,
job_title varchar(500) NOT NULL,
job_description text NOT NULL,
job_status varchar(200) NOT NULL,
apply_by timestamp NULL,
include_assessment_criteria char(1) NULL,
assessment_type varchar(200) NULL,
job_link varchar(100) NULL,
include_assessment_criteria char(1) NOT NULL,
assessment_type varchar(200) NOT NULL,
random_key varchar(10) NULL,
level_id numeric(12) NULL,
secuser_id numeric(12) NULL
);
......
......@@ -9,9 +9,9 @@ CREATE TABLE tl_job_application (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
cv bytea NULL,
candidate_id numeric(12) NULL,
job_id numeric(12) NULL
cv bytea NOT NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -7,11 +7,11 @@
<TABLE name="tl_assessment_criteria" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Name" type="String" dbcol="name" length="200"/>
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="CriteriaType" type="CriteriaType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="Name" type="String" dbcol="name" length="200" mandatory="true"/>
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="CriteriaType" type="CriteriaType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="AssessmentCriterias"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" mandatory="true" backreferenceName="AssessmentCriterias"/>
</TABLE>
......
......@@ -7,11 +7,11 @@
<TABLE name="tl_assessment_criteria_answer" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Answer" type="Boolean" dbcol="answer"/>
<ATTRIB name="Answer" type="Boolean" dbcol="answer" mandatory="true"/>
<ATTRIB name="Notes" type="String" dbcol="notes"/>
<SINGLEREFERENCE name="AssessmentCriteria" type="AssessmentCriteria" dbcol="assessment_criteria_id"/>
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="AssessmentCriteriaAnswers"/>
<SINGLEREFERENCE name="AssessmentCriteria" type="AssessmentCriteria" dbcol="assessment_criteria_id" mandatory="true" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" mandatory="true" backreferenceName="AssessmentCriteriaAnswers"/>
</TABLE>
......
......@@ -115,6 +115,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
metaInfo.put ("backreferenceName", "AssessmentCriterias");
metaInfo.put ("dbcol", "job_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Job");
metaInfo.put ("type", "Job");
......@@ -130,6 +131,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
metaInfo.put ("dbcol", "name");
metaInfo.put ("length", "200");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Name");
metaInfo.put ("type", "String");
......@@ -149,6 +151,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "importance");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Importance");
metaInfo.put ("type", "Importance");
......@@ -168,6 +171,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "assessment_type");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CriteriaType");
metaInfo.put ("type", "CriteriaType");
......@@ -294,6 +298,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
oldAndNewIdentical = HELPER_Name.compare (_Name, newName);
}
BusinessObjectParser.assertFieldCondition (newName != null, this, FIELD_Name, "mandatory");
if (FIELD_Name_Validators.length > 0)
......@@ -392,6 +397,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
oldAndNewIdentical = HELPER_Importance.compare (_Importance, newImportance);
}
BusinessObjectParser.assertFieldCondition (newImportance != null, this, FIELD_Importance, "mandatory");
if (FIELD_Importance_Validators.length > 0)
......@@ -490,6 +496,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
oldAndNewIdentical = HELPER_CriteriaType.compare (_CriteriaType, newCriteriaType);
}
BusinessObjectParser.assertFieldCondition (newCriteriaType != null, this, FIELD_CriteriaType, "mandatory");
if (FIELD_CriteriaType_Validators.length > 0)
......@@ -730,6 +737,7 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
*/
public void setJob (Job newJob) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJob != null, this, SINGLEREFERENCE_Job, "mandatory");
if (_Job.wouldReferencedChange (newJob))
......@@ -1054,6 +1062,8 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
super.validate (context);
context.check (getJobID() != null, this, SINGLEREFERENCE_Job, "mandatory");
}
......@@ -1410,9 +1420,9 @@ public abstract class BaseAssessmentCriteria extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_Name.getAttribObject (getClass (), _Name, false, FIELD_Name));
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, false, FIELD_Importance));
result.add(HELPER_CriteriaType.getAttribObject (getClass (), _CriteriaType, false, FIELD_CriteriaType));
result.add(HELPER_Name.getAttribObject (getClass (), _Name, true, FIELD_Name));
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, true, FIELD_Importance));
result.add(HELPER_CriteriaType.getAttribObject (getClass (), _CriteriaType, true, FIELD_CriteriaType));
return result;
}
......
......@@ -113,6 +113,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "assessment_criteria_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "AssessmentCriteria");
metaInfo.put ("type", "AssessmentCriteria");
......@@ -128,6 +129,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
metaInfo.put ("backreferenceName", "AssessmentCriteriaAnswers");
metaInfo.put ("dbcol", "job_application_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobApplication");
metaInfo.put ("type", "JobApplication");
......@@ -142,6 +144,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "answer");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Answer");
metaInfo.put ("type", "Boolean");
......@@ -287,6 +290,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
oldAndNewIdentical = HELPER_Answer.compare (_Answer, newAnswer);
}
BusinessObjectParser.assertFieldCondition (newAnswer != null, this, FIELD_Answer, "mandatory");
if (FIELD_Answer_Validators.length > 0)
......@@ -645,6 +649,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
*/
public void setAssessmentCriteria (AssessmentCriteria newAssessmentCriteria) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newAssessmentCriteria != null, this, SINGLEREFERENCE_AssessmentCriteria, "mandatory");
if (_AssessmentCriteria.wouldReferencedChange (newAssessmentCriteria))
......@@ -739,6 +744,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
*/
public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJobApplication != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
if (_JobApplication.wouldReferencedChange (newJobApplication))
......@@ -1054,6 +1060,10 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
super.validate (context);
context.check (getAssessmentCriteriaID() != null, this, SINGLEREFERENCE_AssessmentCriteria, "mandatory");
context.check (getJobApplicationID() != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
}
......@@ -1501,7 +1511,7 @@ public abstract class BaseAssessmentCriteriaAnswer extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_Answer.getAttribObject (getClass (), _Answer, false, FIELD_Answer));
result.add(HELPER_Answer.getAttribObject (getClass (), _Answer, true, FIELD_Answer));
result.add(HELPER_Notes.getAttribObject (getClass (), _Notes, false, FIELD_Notes));
return result;
......
......@@ -51,7 +51,6 @@ public abstract class BaseCandidate extends SecUserExtension
public static final String BACKREF_JobApplications = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
......@@ -1359,75 +1358,6 @@ public abstract class BaseCandidate extends SecUserExtension
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<Candidate>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andPhone (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.phone", "Phone");
return this;
}
public SearchAll andTestInput (QueryFilter<TestInput> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
return this;
}
public SearchAll andUser (QueryFilter<SecUser> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.user_id", "User");
return this;
}
public Candidate[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_Candidate, SEARCH_All, criteria);
Set<Candidate> typedResults = new LinkedHashSet <Candidate> ();
for (BaseBusinessClass bbcResult : results)
{
Candidate aResult = (Candidate)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new Candidate[0]);
}
}
public static Candidate[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
......
......@@ -110,6 +110,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "culture_element_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CultureElement");
metaInfo.put ("type", "CultureElement");
......@@ -124,6 +125,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "culture_element_rating_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CultureElementRating");
metaInfo.put ("type", "CultureElementRating");
......@@ -139,6 +141,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
metaInfo.put ("backreferenceName", "CultureCriterias");
metaInfo.put ("dbcol", "job_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Job");
metaInfo.put ("type", "Job");
......@@ -154,6 +157,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "importance");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Importance");
metaInfo.put ("type", "Importance");
......@@ -282,6 +286,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
oldAndNewIdentical = HELPER_Importance.compare (_Importance, newImportance);
}
BusinessObjectParser.assertFieldCondition (newImportance != null, this, FIELD_Importance, "mandatory");
if (FIELD_Importance_Validators.length > 0)
......@@ -562,6 +567,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
*/
public void setCultureElement (CultureElement newCultureElement) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newCultureElement != null, this, SINGLEREFERENCE_CultureElement, "mandatory");
if (_CultureElement.wouldReferencedChange (newCultureElement))
......@@ -656,6 +662,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
*/
public void setCultureElementRating (CultureElementRating newCultureElementRating) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newCultureElementRating != null, this, SINGLEREFERENCE_CultureElementRating, "mandatory");
if (_CultureElementRating.wouldReferencedChange (newCultureElementRating))
......@@ -750,6 +757,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
*/
public void setJob (Job newJob) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJob != null, this, SINGLEREFERENCE_Job, "mandatory");
if (_Job.wouldReferencedChange (newJob))
......@@ -1056,6 +1064,12 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
super.validate (context);
context.check (getCultureElementID() != null, this, SINGLEREFERENCE_CultureElement, "mandatory");
context.check (getCultureElementRatingID() != null, this, SINGLEREFERENCE_CultureElementRating, "mandatory");
context.check (getJobID() != null, this, SINGLEREFERENCE_Job, "mandatory");
}
......@@ -1380,7 +1394,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, false, FIELD_Importance));
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, true, FIELD_Importance));
return result;
}
......
......@@ -103,6 +103,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "culture_criteria_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CultureCriteria");
metaInfo.put ("type", "CultureCriteria");
......@@ -117,6 +118,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "selected_question_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "SelectedQuestion");
metaInfo.put ("type", "CultureElementQuestion");
......@@ -132,6 +134,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
metaInfo.put ("backreferenceName", "CultureCriteriaAnswers");
metaInfo.put ("dbcol", "job_application_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobApplication");
metaInfo.put ("type", "JobApplication");
......@@ -437,6 +440,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
*/
public void setCultureCriteria (CultureCriteria newCultureCriteria) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newCultureCriteria != null, this, SINGLEREFERENCE_CultureCriteria, "mandatory");
if (_CultureCriteria.wouldReferencedChange (newCultureCriteria))
......@@ -531,6 +535,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
*/
public void setSelectedQuestion (CultureElementQuestion newSelectedQuestion) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newSelectedQuestion != null, this, SINGLEREFERENCE_SelectedQuestion, "mandatory");
if (_SelectedQuestion.wouldReferencedChange (newSelectedQuestion))
......@@ -625,6 +630,7 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
*/
public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJobApplication != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
if (_JobApplication.wouldReferencedChange (newJobApplication))
......@@ -919,6 +925,12 @@ public abstract class BaseCultureCriteriaAnswer extends BaseBusinessClass
super.validate (context);
context.check (getCultureCriteriaID() != null, this, SINGLEREFERENCE_CultureCriteria, "mandatory");
context.check (getSelectedQuestionID() != null, this, SINGLEREFERENCE_SelectedQuestion, "mandatory");
context.check (getJobApplicationID() != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
}
......
......@@ -48,7 +48,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String FIELD_ApplyBy = "ApplyBy";
public static final String FIELD_IncludeAssessmentCriteria = "IncludeAssessmentCriteria";
public static final String FIELD_AssessmentType = "AssessmentType";
public static final String FIELD_JobLink = "JobLink";
public static final String FIELD_RandomKey = "RandomKey";
public static final String FIELD_Email = "Email";
public static final String SINGLEREFERENCE_Level = "Level";
public static final String SINGLEREFERENCE_SecUser = "SecUser";
......@@ -70,7 +70,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final DefaultAttributeHelper<Job> HELPER_ApplyBy = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_IncludeAssessmentCriteria = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Job, AssessmentType> HELPER_AssessmentType = new EnumeratedAttributeHelper<Job, AssessmentType> (AssessmentType.FACTORY_AssessmentType);
private static final DefaultAttributeHelper<Job> HELPER_JobLink = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_RandomKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_Email = DefaultAttributeHelper.INSTANCE;
......@@ -81,7 +81,7 @@ public abstract class BaseJob extends BaseBusinessClass
private Date _ApplyBy;
private Boolean _IncludeAssessmentCriteria;
private AssessmentType _AssessmentType;
private String _JobLink;
private String _RandomKey;
private String _Email;
......@@ -107,7 +107,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final AttributeValidator[] FIELD_ApplyBy_Validators;
private static final AttributeValidator[] FIELD_IncludeAssessmentCriteria_Validators;
private static final AttributeValidator[] FIELD_AssessmentType_Validators;
private static final AttributeValidator[] FIELD_JobLink_Validators;
private static final AttributeValidator[] FIELD_RandomKey_Validators;
// Arrays of behaviour decorators
......@@ -136,7 +136,7 @@ public abstract class BaseJob extends BaseBusinessClass
FIELD_ApplyBy_Validators = (AttributeValidator[])setupAttribMetaData_ApplyBy(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IncludeAssessmentCriteria_Validators = (AttributeValidator[])setupAttribMetaData_IncludeAssessmentCriteria(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AssessmentType_Validators = (AttributeValidator[])setupAttribMetaData_AssessmentType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobLink_Validators = (AttributeValidator[])setupAttribMetaData_JobLink(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RandomKey_Validators = (AttributeValidator[])setupAttribMetaData_RandomKey(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Job.initialiseReference ();
......@@ -199,6 +199,7 @@ public abstract class BaseJob extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "level_id");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "Level");
metaInfo.put ("type", "Level");
......@@ -246,6 +247,7 @@ public abstract class BaseJob extends BaseBusinessClass
metaInfo.put ("dbcol", "job_title");
metaInfo.put ("length", "500");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobTitle");
metaInfo.put ("type", "String");
......@@ -264,6 +266,7 @@ public abstract class BaseJob extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_description");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobDescription");
metaInfo.put ("type", "String");
......@@ -283,6 +286,8 @@ public abstract class BaseJob extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "job_status");
metaInfo.put ("defaultValue", "JobStatus.DRAFT");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobStatus");
metaInfo.put ("type", "JobStatus");
......@@ -319,6 +324,8 @@ public abstract class BaseJob extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "include_assessment_criteria");
metaInfo.put ("defaultValue", "Boolean.TRUE");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "IncludeAssessmentCriteria");
metaInfo.put ("type", "Boolean");
......@@ -338,6 +345,8 @@ public abstract class BaseJob extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "assessment_type");
metaInfo.put ("defaultValue", "AssessmentType.COMPREHENSIVE");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "AssessmentType");
metaInfo.put ("type", "AssessmentType");
......@@ -351,20 +360,20 @@ public abstract class BaseJob extends BaseBusinessClass
}
// Meta Info setup
private static List setupAttribMetaData_JobLink(Map validatorMapping)
private static List setupAttribMetaData_RandomKey(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_link");
metaInfo.put ("length", "100");
metaInfo.put ("name", "JobLink");
metaInfo.put ("dbcol", "random_key");
metaInfo.put ("length", "10");
metaInfo.put ("name", "RandomKey");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.JobLink:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_JobLink, Collections.unmodifiableMap (metaInfo));
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.RandomKey:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_RandomKey, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Job.class, "JobLink", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.JobLink:", validators);
List validators = BaseBusinessClass.getAttribValidators(Job.class, "RandomKey", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.RandomKey:", validators);
return validators;
}
......@@ -398,11 +407,11 @@ public abstract class BaseJob extends BaseBusinessClass
_JobTitle = (String)(HELPER_JobTitle.initialise (_JobTitle));
_JobDescription = (String)(HELPER_JobDescription.initialise (_JobDescription));
_JobStatus = (JobStatus)(HELPER_JobStatus.initialise (_JobStatus));
_JobStatus = (JobStatus)(JobStatus.DRAFT);
_ApplyBy = (Date)(HELPER_ApplyBy.initialise (_ApplyBy));
_IncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.initialise (_IncludeAssessmentCriteria));
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (_AssessmentType));
_JobLink = (String)(HELPER_JobLink.initialise (_JobLink));
_IncludeAssessmentCriteria = (Boolean)(Boolean.TRUE);
_AssessmentType = (AssessmentType)(AssessmentType.COMPREHENSIVE);
_RandomKey = (String)(HELPER_RandomKey.initialise (_RandomKey));
_Email = (String)(HELPER_Email.initialise (_Email));
}
......@@ -496,6 +505,7 @@ public abstract class BaseJob extends BaseBusinessClass
oldAndNewIdentical = HELPER_JobTitle.compare (_JobTitle, newJobTitle);
}
BusinessObjectParser.assertFieldCondition (newJobTitle != null, this, FIELD_JobTitle, "mandatory");
if (FIELD_JobTitle_Validators.length > 0)
......@@ -594,6 +604,7 @@ public abstract class BaseJob extends BaseBusinessClass
oldAndNewIdentical = HELPER_JobDescription.compare (_JobDescription, newJobDescription);
}
BusinessObjectParser.assertFieldCondition (newJobDescription != null, this, FIELD_JobDescription, "mandatory");
if (FIELD_JobDescription_Validators.length > 0)
......@@ -692,6 +703,7 @@ public abstract class BaseJob extends BaseBusinessClass
oldAndNewIdentical = HELPER_JobStatus.compare (_JobStatus, newJobStatus);
}
BusinessObjectParser.assertFieldCondition (newJobStatus != null, this, FIELD_JobStatus, "mandatory");
if (FIELD_JobStatus_Validators.length > 0)
......@@ -888,6 +900,7 @@ public abstract class BaseJob extends BaseBusinessClass
oldAndNewIdentical = HELPER_IncludeAssessmentCriteria.compare (_IncludeAssessmentCriteria, newIncludeAssessmentCriteria);
}
BusinessObjectParser.assertFieldCondition (newIncludeAssessmentCriteria != null, this, FIELD_IncludeAssessmentCriteria, "mandatory");
if (FIELD_IncludeAssessmentCriteria_Validators.length > 0)
......@@ -986,6 +999,7 @@ public abstract class BaseJob extends BaseBusinessClass
oldAndNewIdentical = HELPER_AssessmentType.compare (_AssessmentType, newAssessmentType);
}
BusinessObjectParser.assertFieldCondition (newAssessmentType != null, this, FIELD_AssessmentType, "mandatory");
if (FIELD_AssessmentType_Validators.length > 0)
......@@ -1027,16 +1041,16 @@ public abstract class BaseJob extends BaseBusinessClass
}
/**
* Get the attribute JobLink
* Get the attribute RandomKey
*/
public String getJobLink ()
public String getRandomKey ()
{
assertValid();
String valToReturn = _JobLink;
String valToReturn = _RandomKey;
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
valToReturn = bhd.getJobLink ((Job)this, valToReturn);
valToReturn = bhd.getRandomKey ((Job)this, valToReturn);
}
return valToReturn;
......@@ -1048,7 +1062,7 @@ public abstract class BaseJob extends BaseBusinessClass
* 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.
*/
protected void preJobLinkChange (String newJobLink) throws FieldException
protected void preRandomKeyChange (String newRandomKey) throws FieldException
{
}
......@@ -1058,46 +1072,46 @@ public abstract class BaseJob extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobLinkChange () throws FieldException
protected void postRandomKeyChange () throws FieldException
{
}
public FieldWriteability getWriteability_JobLink ()
public FieldWriteability getWriteability_RandomKey ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute JobLink. Checks to ensure a new value
* Set the attribute RandomKey. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setJobLink (String newJobLink) throws FieldException
public void setRandomKey (String newRandomKey) throws FieldException
{
boolean oldAndNewIdentical = HELPER_JobLink.compare (_JobLink, newJobLink);
boolean oldAndNewIdentical = HELPER_RandomKey.compare (_RandomKey, newRandomKey);
try
{
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
newJobLink = bhd.setJobLink ((Job)this, newJobLink);
oldAndNewIdentical = HELPER_JobLink.compare (_JobLink, newJobLink);
newRandomKey = bhd.setRandomKey ((Job)this, newRandomKey);
oldAndNewIdentical = HELPER_RandomKey.compare (_RandomKey, newRandomKey);
}
if (FIELD_JobLink_Validators.length > 0)
if (FIELD_RandomKey_Validators.length > 0)
{
Object newJobLinkObj = HELPER_JobLink.toObject (newJobLink);
Object newRandomKeyObj = HELPER_RandomKey.toObject (newRandomKey);
if (newJobLinkObj != null)
if (newRandomKeyObj != null)
{
int loopMax = FIELD_JobLink_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_JobLink);
int loopMax = FIELD_RandomKey_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_RandomKey);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_JobLink_Validators[v].checkAttribute (this, FIELD_JobLink, metadata, newJobLinkObj);
FIELD_RandomKey_Validators[v].checkAttribute (this, FIELD_RandomKey, metadata, newRandomKeyObj);
}
}
}
......@@ -1115,12 +1129,12 @@ public abstract class BaseJob extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_JobLink () != FieldWriteability.FALSE, "Field JobLink is not writeable");
preJobLinkChange (newJobLink);
markFieldChange (FIELD_JobLink);
_JobLink = newJobLink;
postFieldChange (FIELD_JobLink);
postJobLinkChange ();
Debug.assertion (getWriteability_RandomKey () != FieldWriteability.FALSE, "Field RandomKey is not writeable");
preRandomKeyChange (newRandomKey);
markFieldChange (FIELD_RandomKey);
_RandomKey = newRandomKey;
postFieldChange (FIELD_RandomKey);
postRandomKeyChange ();
}
}
......@@ -2080,7 +2094,7 @@ public abstract class BaseJob extends BaseBusinessClass
tl_jobPSet.setAttrib (FIELD_ApplyBy, HELPER_ApplyBy.toObject (_ApplyBy)); //
tl_jobPSet.setAttrib (FIELD_IncludeAssessmentCriteria, HELPER_IncludeAssessmentCriteria.toObject (_IncludeAssessmentCriteria)); //
tl_jobPSet.setAttrib (FIELD_AssessmentType, HELPER_AssessmentType.toObject (_AssessmentType)); //
tl_jobPSet.setAttrib (FIELD_JobLink, HELPER_JobLink.toObject (_JobLink)); //
tl_jobPSet.setAttrib (FIELD_RandomKey, HELPER_RandomKey.toObject (_RandomKey)); //
_Level.getPersistentSets (allSets);
_SecUser.getPersistentSets (allSets);
......@@ -2103,7 +2117,7 @@ public abstract class BaseJob extends BaseBusinessClass
_ApplyBy = (Date)(HELPER_ApplyBy.fromObject (_ApplyBy, tl_jobPSet.getAttrib (FIELD_ApplyBy))); //
_IncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.fromObject (_IncludeAssessmentCriteria, tl_jobPSet.getAttrib (FIELD_IncludeAssessmentCriteria))); //
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, tl_jobPSet.getAttrib (FIELD_AssessmentType))); //
_JobLink = (String)(HELPER_JobLink.fromObject (_JobLink, tl_jobPSet.getAttrib (FIELD_JobLink))); //
_RandomKey = (String)(HELPER_RandomKey.fromObject (_RandomKey, tl_jobPSet.getAttrib (FIELD_RandomKey))); //
_Level.setFromPersistentSets (objectID, allSets);
_SecUser.setFromPersistentSets (objectID, allSets);
......@@ -2177,7 +2191,7 @@ public abstract class BaseJob extends BaseBusinessClass
try
{
setJobLink (otherJob.getJobLink ());
setRandomKey (otherJob.getRandomKey ());
}
catch (FieldException ex)
{
......@@ -2205,7 +2219,7 @@ public abstract class BaseJob extends BaseBusinessClass
_ApplyBy = sourceJob._ApplyBy;
_IncludeAssessmentCriteria = sourceJob._IncludeAssessmentCriteria;
_AssessmentType = sourceJob._AssessmentType;
_JobLink = sourceJob._JobLink;
_RandomKey = sourceJob._RandomKey;
_Email = sourceJob._Email;
}
......@@ -2270,7 +2284,7 @@ public abstract class BaseJob extends BaseBusinessClass
_ApplyBy = (Date)(HELPER_ApplyBy.readExternal (_ApplyBy, vals.get(FIELD_ApplyBy))); //
_IncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.readExternal (_IncludeAssessmentCriteria, vals.get(FIELD_IncludeAssessmentCriteria))); //
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.readExternal (_AssessmentType, vals.get(FIELD_AssessmentType))); //
_JobLink = (String)(HELPER_JobLink.readExternal (_JobLink, vals.get(FIELD_JobLink))); //
_RandomKey = (String)(HELPER_RandomKey.readExternal (_RandomKey, vals.get(FIELD_RandomKey))); //
_Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
_Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
_SecUser.readExternalData(vals.get(SINGLEREFERENCE_SecUser));
......@@ -2294,7 +2308,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (FIELD_ApplyBy, HELPER_ApplyBy.writeExternal (_ApplyBy));
vals.put (FIELD_IncludeAssessmentCriteria, HELPER_IncludeAssessmentCriteria.writeExternal (_IncludeAssessmentCriteria));
vals.put (FIELD_AssessmentType, HELPER_AssessmentType.writeExternal (_AssessmentType));
vals.put (FIELD_JobLink, HELPER_JobLink.writeExternal (_JobLink));
vals.put (FIELD_RandomKey, HELPER_RandomKey.writeExternal (_RandomKey));
vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
vals.put (SINGLEREFERENCE_SecUser, _SecUser.writeExternalData());
......@@ -2338,9 +2352,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_AssessmentType, HELPER_AssessmentType.toObject(this._AssessmentType), HELPER_AssessmentType.toObject(otherJob._AssessmentType));
}
if (!HELPER_JobLink.compare(this._JobLink, otherJob._JobLink))
if (!HELPER_RandomKey.compare(this._RandomKey, otherJob._RandomKey))
{
listener.notifyFieldChange(this, other, FIELD_JobLink, HELPER_JobLink.toObject(this._JobLink), HELPER_JobLink.toObject(otherJob._JobLink));
listener.notifyFieldChange(this, other, FIELD_RandomKey, HELPER_RandomKey.toObject(this._RandomKey), HELPER_RandomKey.toObject(otherJob._RandomKey));
}
// Compare single assocs
......@@ -2376,7 +2390,7 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitField(this, FIELD_ApplyBy, HELPER_ApplyBy.toObject(getApplyBy()));
visitor.visitField(this, FIELD_IncludeAssessmentCriteria, HELPER_IncludeAssessmentCriteria.toObject(getIncludeAssessmentCriteria()));
visitor.visitField(this, FIELD_AssessmentType, HELPER_AssessmentType.toObject(getAssessmentType()));
visitor.visitField(this, FIELD_JobLink, HELPER_JobLink.toObject(getJobLink()));
visitor.visitField(this, FIELD_RandomKey, HELPER_RandomKey.toObject(getRandomKey()));
visitor.visitAssociation (_Level);
visitor.visitAssociation (_SecUser);
visitor.visitAssociation (_JobApplications);
......@@ -2459,9 +2473,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
return filter.matches (getAssessmentType ());
}
else if (attribName.equals (FIELD_JobLink))
else if (attribName.equals (FIELD_RandomKey))
{
return filter.matches (getJobLink ());
return filter.matches (getRandomKey ());
}
else if (attribName.equals (SINGLEREFERENCE_Level))
{
......@@ -2538,9 +2552,9 @@ public abstract class BaseJob extends BaseBusinessClass
return this;
}
public SearchAll andJobLink (QueryFilter<String> filter)
public SearchAll andRandomKey (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.job_link", "JobLink");
filter.addFilter (context, "tl_job.random_key", "RandomKey");
return this;
}
......@@ -2615,9 +2629,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_AssessmentType.toObject (getAssessmentType ());
}
else if (attribName.equals (FIELD_JobLink))
else if (attribName.equals (FIELD_RandomKey))
{
return HELPER_JobLink.toObject (getJobLink ());
return HELPER_RandomKey.toObject (getRandomKey ());
}
else if (attribName.equals (FIELD_Email))
{
......@@ -2660,9 +2674,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_AssessmentType;
}
else if (attribName.equals (FIELD_JobLink))
else if (attribName.equals (FIELD_RandomKey))
{
return HELPER_JobLink;
return HELPER_RandomKey;
}
else if (attribName.equals (FIELD_Email))
{
......@@ -2705,9 +2719,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
setAssessmentType ((AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, attribValue)));
}
else if (attribName.equals (FIELD_JobLink))
else if (attribName.equals (FIELD_RandomKey))
{
setJobLink ((String)(HELPER_JobLink.fromObject (_JobLink, attribValue)));
setRandomKey ((String)(HELPER_RandomKey.fromObject (_RandomKey, attribValue)));
}
else if (attribName.equals (FIELD_Email))
{
......@@ -2757,9 +2771,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
return getWriteability_AssessmentType ();
}
else if (fieldName.equals (FIELD_JobLink))
else if (fieldName.equals (FIELD_RandomKey))
{
return getWriteability_JobLink ();
return getWriteability_RandomKey ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_JobApplications))
{
......@@ -2825,9 +2839,9 @@ public abstract class BaseJob extends BaseBusinessClass
fields.add (FIELD_AssessmentType);
}
if (getWriteability_JobLink () != FieldWriteability.TRUE)
if (getWriteability_RandomKey () != FieldWriteability.TRUE)
{
fields.add (FIELD_JobLink);
fields.add (FIELD_RandomKey);
}
if (getWriteability_Email () != FieldWriteability.TRUE)
......@@ -2844,13 +2858,13 @@ public abstract class BaseJob extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_JobTitle.getAttribObject (getClass (), _JobTitle, false, FIELD_JobTitle));
result.add(HELPER_JobDescription.getAttribObject (getClass (), _JobDescription, false, FIELD_JobDescription));
result.add(HELPER_JobStatus.getAttribObject (getClass (), _JobStatus, false, FIELD_JobStatus));
result.add(HELPER_JobTitle.getAttribObject (getClass (), _JobTitle, true, FIELD_JobTitle));
result.add(HELPER_JobDescription.getAttribObject (getClass (), _JobDescription, true, FIELD_JobDescription));
result.add(HELPER_JobStatus.getAttribObject (getClass (), _JobStatus, true, FIELD_JobStatus));
result.add(HELPER_ApplyBy.getAttribObject (getClass (), _ApplyBy, false, FIELD_ApplyBy));
result.add(HELPER_IncludeAssessmentCriteria.getAttribObject (getClass (), _IncludeAssessmentCriteria, false, FIELD_IncludeAssessmentCriteria));
result.add(HELPER_AssessmentType.getAttribObject (getClass (), _AssessmentType, false, FIELD_AssessmentType));
result.add(HELPER_JobLink.getAttribObject (getClass (), _JobLink, false, FIELD_JobLink));
result.add(HELPER_IncludeAssessmentCriteria.getAttribObject (getClass (), _IncludeAssessmentCriteria, true, FIELD_IncludeAssessmentCriteria));
result.add(HELPER_AssessmentType.getAttribObject (getClass (), _AssessmentType, true, FIELD_AssessmentType));
result.add(HELPER_RandomKey.getAttribObject (getClass (), _RandomKey, false, FIELD_RandomKey));
result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));
return result;
......@@ -3011,21 +3025,21 @@ public abstract class BaseJob extends BaseBusinessClass
}
/**
* Get the attribute JobLink
* Get the attribute RandomKey
*/
public String getJobLink (Job obj, String original)
public String getRandomKey (Job obj, String original)
{
return original;
}
/**
* Change the value set for attribute JobLink.
* Change the value set for attribute RandomKey.
* May modify the field beforehand
* Occurs before validation.
*/
public String setJobLink (Job obj, String newJobLink) throws FieldException
public String setRandomKey (Job obj, String newRandomKey) throws FieldException
{
return newJobLink;
return newRandomKey;
}
/**
......@@ -3138,9 +3152,9 @@ public abstract class BaseJob extends BaseBusinessClass
{
return toAssessmentType ();
}
if (name.equals ("JobLink"))
if (name.equals ("RandomKey"))
{
return toJobLink ();
return toRandomKey ();
}
if (name.equals ("Level"))
{
......@@ -3170,7 +3184,7 @@ public abstract class BaseJob extends BaseBusinessClass
public PipeLine<From, AssessmentType> toAssessmentType () { return pipe(new ORMAttributePipe<Me, AssessmentType>(FIELD_AssessmentType)); }
public PipeLine<From, String> toJobLink () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobLink)); }
public PipeLine<From, String> toRandomKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_RandomKey)); }
public Level.LevelPipeLineFactory<From, Level> toLevel () { return toLevel (Filter.ALL); }
public Level.LevelPipeLineFactory<From, Level> toLevel (Filter<Level> filter)
......
......@@ -147,6 +147,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
metaInfo.put ("backreferenceName", "JobApplications");
metaInfo.put ("dbcol", "candidate_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Candidate");
metaInfo.put ("type", "Candidate");
......@@ -162,6 +163,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
metaInfo.put ("backreferenceName", "JobApplications");
metaInfo.put ("dbcol", "job_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Job");
metaInfo.put ("type", "Job");
......@@ -179,6 +181,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
metaInfo.put ("binaryHandler", "loggedin");
metaInfo.put ("dbcol", "cv");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CV");
metaInfo.put ("type", "BinaryContent");
......@@ -309,6 +312,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
oldAndNewIdentical = HELPER_CV.compare (_CV, newCV);
}
BusinessObjectParser.assertFieldCondition (newCV != null, this, FIELD_CV, "mandatory");
if (FIELD_CV_Validators.length > 0)
......@@ -569,6 +573,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
*/
public void setCandidate (Candidate newCandidate) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newCandidate != null, this, SINGLEREFERENCE_Candidate, "mandatory");
if (_Candidate.wouldReferencedChange (newCandidate))
......@@ -676,6 +681,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
*/
public void setJob (Job newJob) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJob != null, this, SINGLEREFERENCE_Job, "mandatory");
if (_Job.wouldReferencedChange (newJob))
......@@ -1239,6 +1245,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
super.validate (context);
context.check (getCandidateID() != null, this, SINGLEREFERENCE_Candidate, "mandatory");
context.check (getJobID() != null, this, SINGLEREFERENCE_Job, "mandatory");
}
......@@ -1646,7 +1656,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_CV.getAttribObject (getClass (), _CV, false, FIELD_CV));
result.add(HELPER_CV.getAttribObject (getClass (), _CV, true, FIELD_CV));
return result;
}
......
......@@ -14,12 +14,10 @@
<ATTRIB name="Phone" type="String" dbcol="phone" length="30"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" inSuper='TRUE' backreferenceName="Extensions" />
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates" />
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
</TABLE>
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" orderBy="oneit_sec_user_extension.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -282,10 +282,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
......@@ -428,44 +424,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
return results;
}
else if (searchType.equals (Candidate.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY oneit_sec_user_extension.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
......
......@@ -7,11 +7,11 @@
<TABLE name="tl_culture_criteria" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" mandatory="true" />
<SINGLEREFERENCE name="CultureElement" type="CultureElement" dbcol="culture_element_id"/>
<SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="CultureCriterias"/>
<SINGLEREFERENCE name="CultureElement" type="CultureElement" dbcol="culture_element_id" mandatory="true" />
<SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id" mandatory="true" />
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" mandatory="true" backreferenceName="CultureCriterias"/>
</TABLE>
......
......@@ -6,9 +6,9 @@
<TABLE name="tl_culture_criteria_answer" tablePrefix="object" polymorphic="FALSE">
<SINGLEREFERENCE name="CultureCriteria" type="CultureCriteria" dbcol="culture_criteria_id"/>
<SINGLEREFERENCE name="SelectedQuestion" type="CultureElementQuestion" dbcol="selected_question_id"/>
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="CultureCriteriaAnswers"/>
<SINGLEREFERENCE name="CultureCriteria" type="CultureCriteria" dbcol="culture_criteria_id" mandatory="true" />
<SINGLEREFERENCE name="SelectedQuestion" type="CultureElementQuestion" dbcol="selected_question_id" mandatory="true" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" mandatory="true" backreferenceName="CultureCriteriaAnswers"/>
</TABLE>
......
package performa.orm;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import oneit.logging.LoggingArea;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.utils.BusinessException;
import oneit.utils.*;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter;
import performa.orm.types.CriteriaType;
......@@ -30,7 +28,7 @@ public class Job extends BaseJob
{
super.postInitNewObj();
setLevel(Level.createLevel(getTransaction()));
setRandomKey(RandomStringGen.getRandomStringGen().generateAlphaNum(4));
}
......@@ -64,5 +62,4 @@ public class Job extends BaseJob
return CollectionFilter.filter(getAssessmentCriteriasSet(), filter);
}
}
\ No newline at end of file
......@@ -14,15 +14,15 @@
<TABLE name="tl_job" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="500"/>
<ATTRIB name="JobDescription" type="String" dbcol="job_description"/>
<ATTRIB name="JobStatus" type="JobStatus" dbcol="job_status" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="500" mandatory="true"/>
<ATTRIB name="JobDescription" type="String" dbcol="job_description" mandatory="true"/>
<ATTRIB name="JobStatus" type="JobStatus" dbcol="job_status" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="JobStatus.DRAFT"/>
<ATTRIB name="ApplyBy" type="Date" dbcol="apply_by"/>
<ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria"/>
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="JobLink" type="String" dbcol="job_link" length="100"/>
<ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.TRUE"/>
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/>
<ATTRIB name="RandomKey" type="String" dbcol="random_key" length="10"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" />
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="SecUser" type="SecUser" dbcol="secuser_id" />
</TABLE>
......
......@@ -9,10 +9,10 @@
<TABLE name="tl_job_application" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="CV" type="BinaryContent" dbcol="cv" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<ATTRIB name="CV" type="BinaryContent" dbcol="cv" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" mandatory="true"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications" mandatory="true"/>
</TABLE>
......
......@@ -34,7 +34,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
private Date dummyApplyBy;
private Boolean dummyIncludeAssessmentCriteria;
private AssessmentType dummyAssessmentType;
private String dummyJobLink;
private String dummyRandomKey;
// Static constants corresponding to attribute helpers
......@@ -44,7 +44,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_ApplyBy = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IncludeAssessmentCriteria = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_AssessmentType = new EnumeratedAttributeHelper (AssessmentType.FACTORY_AssessmentType);
private static final DefaultAttributeHelper HELPER_JobLink = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_RandomKey = DefaultAttributeHelper.INSTANCE;
......@@ -57,11 +57,11 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
dummyApplyBy = (Date)(HELPER_ApplyBy.initialise (dummyApplyBy));
dummyIncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.initialise (dummyIncludeAssessmentCriteria));
dummyAssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (dummyAssessmentType));
dummyJobLink = (String)(HELPER_JobLink.initialise (dummyJobLink));
dummyRandomKey = (String)(HELPER_RandomKey.initialise (dummyRandomKey));
}
private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.job_link, {PREFIX}tl_job.level_id, {PREFIX}tl_job.secuser_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.level_id, {PREFIX}tl_job.secuser_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -118,7 +118,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!tl_jobPSet.containsAttrib(Job.FIELD_ApplyBy)||
!tl_jobPSet.containsAttrib(Job.FIELD_IncludeAssessmentCriteria)||
!tl_jobPSet.containsAttrib(Job.FIELD_AssessmentType)||
!tl_jobPSet.containsAttrib(Job.FIELD_JobLink)||
!tl_jobPSet.containsAttrib(Job.FIELD_RandomKey)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Level)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_SecUser))
{
......@@ -190,10 +190,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job " +
"SET job_title = ?, job_description = ?, job_status = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, job_link = ?, level_id = ? , secuser_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET job_title = ?, job_description = ?, job_status = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, level_id = ? , secuser_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_JobLink.getForSQL(dummyJobLink, tl_jobPSet.getAttrib (Job.FIELD_JobLink))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -455,7 +455,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
tl_jobPSet.setAttrib(Job.FIELD_ApplyBy, HELPER_ApplyBy.getFromRS(dummyApplyBy, r, "apply_by"));
tl_jobPSet.setAttrib(Job.FIELD_IncludeAssessmentCriteria, HELPER_IncludeAssessmentCriteria.getFromRS(dummyIncludeAssessmentCriteria, r, "include_assessment_criteria"));
tl_jobPSet.setAttrib(Job.FIELD_AssessmentType, HELPER_AssessmentType.getFromRS(dummyAssessmentType, r, "assessment_type"));
tl_jobPSet.setAttrib(Job.FIELD_JobLink, HELPER_JobLink.getFromRS(dummyJobLink, r, "job_link"));
tl_jobPSet.setAttrib(Job.FIELD_RandomKey, HELPER_RandomKey.getFromRS(dummyRandomKey, r, "random_key"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Level, r.getObject ("level_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_SecUser, r.getObject ("secuser_id"));
......@@ -475,10 +475,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job " +
" (job_title, job_description, job_status, apply_by, include_assessment_criteria, assessment_type, job_link, level_id, secuser_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (job_title, job_description, job_status, apply_by, include_assessment_criteria, assessment_type, random_key, level_id, secuser_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_JobLink.getForSQL(dummyJobLink, tl_jobPSet.getAttrib (Job.FIELD_JobLink))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))) .listEntry (objectID.longID ()).toList().toArray());
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -8,10 +8,10 @@
<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="name" type="String" nullable="true" length="200"/>
<column name="importance" type="String" nullable="true" length="200"/>
<column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="name" type="String" nullable="false" length="200"/>
<column name="importance" type="String" nullable="false" length="200"/>
<column name="assessment_type" type="String" nullable="false" length="200"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_criteria" indexName="idx_tl_assessment_criteria_job_id" isUnique="false"><column name="job_id"/></NODE>
......
......@@ -8,10 +8,10 @@
<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" type="Boolean" nullable="true"/>
<column name="answer" type="Boolean" nullable="false"/>
<column name="notes" type="CLOB" nullable="true"/>
<column name="assessment_criteria_id" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="assessment_criteria_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_criteria_answer" indexName="idx_tl_assessment_criteria_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
......
......@@ -8,10 +8,10 @@
<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="importance" type="String" nullable="true" length="200"/>
<column name="culture_element_id" type="Long" length="11" nullable="true"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="importance" type="String" nullable="false" length="200"/>
<column name="culture_element_id" type="Long" length="11" nullable="false"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_criteria" indexName="idx_tl_culture_criteria_job_id" isUnique="false"><column name="job_id"/></NODE>
......
......@@ -8,9 +8,9 @@
<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="culture_criteria_id" type="Long" length="11" nullable="true"/>
<column name="selected_question_id" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/>
<column name="culture_criteria_id" type="Long" length="11" nullable="false"/>
<column name="selected_question_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_criteria_answer" indexName="idx_tl_culture_criteria_answer_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
......
......@@ -8,12 +8,12 @@
<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="job_title" type="String" nullable="true" length="500"/>
<column name="job_description" type="CLOB" nullable="true"/>
<column name="job_status" type="String" nullable="true" length="200"/>
<column name="job_title" type="String" nullable="false" length="500"/>
<column name="job_description" type="CLOB" nullable="false"/>
<column name="job_status" type="String" nullable="false" length="200"/>
<column name="apply_by" type="Date" nullable="true"/>
<column name="include_assessment_criteria" type="Boolean" nullable="true"/>
<column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="include_assessment_criteria" type="Boolean" nullable="false"/>
<column name="assessment_type" type="String" nullable="false" length="200"/>
<column name="job_link" type="String" nullable="true" length="100"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="secuser_id" type="Long" length="11" nullable="true"/>
......
......@@ -8,9 +8,9 @@
<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="cv" type="BLOB" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="cv" type="BLOB" nullable="false"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job_application" indexName="idx_tl_job_application_candidate_id" isUnique="false"><column name="candidate_id"/></NODE>
......
alter table tl_job drop column job_link;
<?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.RedefineTableOperation">
<tableName factory="String">tl_job</tableName>
<column name="random_key" type="String" nullable="true" length="10"/>
</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