Commit aefb0786 by Jay

S21293603 # Client - Incoming Issues (raised by Client) #Convert Occupation to Standard Job Title

parent 0c88d4cc
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<column name="client_id" type="Long" length="11" nullable="true"/> <column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/> <column name="company_user_id" type="Long" length="11" nullable="true"/>
<column name="job_title_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE>
......
<?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_ilo_job_title</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="job_title" type="String" nullable="true" length="200"/>
<column name="occupation_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<column name="occupation_id" type="Long" length="11" nullable="false"/> <column name="occupation_id" type="Long" length="11" nullable="false"/>
<column name="shortened_url_id" type="Long" length="11" nullable="true"/> <column name="shortened_url_id" type="Long" length="11" nullable="true"/>
<column name="template_id" type="Long" length="11" nullable="true"/> <column name="template_id" type="Long" length="11" nullable="true"/>
<column name="job_title_id" type="Long" length="11" nullable="false"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE>
......
...@@ -26,7 +26,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -26,7 +26,8 @@ CREATE TABLE tl_assessment_template (
job_id numeric(12) NULL, job_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- DROP TABLE tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
job_title varchar(200) NULL,
occupation_id numeric(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT PK_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -40,7 +40,8 @@ CREATE TABLE tl_job ( ...@@ -40,7 +40,8 @@ CREATE TABLE tl_job (
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL, shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL template_id numeric(12) NULL,
job_title_id numeric(12) NOT NULL
); );
......
...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template (
job_id number(12) NULL, job_id number(12) NULL,
client_id number(12) NULL, client_id number(12) NULL,
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
company_user_id number(12) NULL company_user_id number(12) NULL,
job_title_id number(12) NULL
); );
......
-- DROP TABLE tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
job_title varchar2(200) NULL,
occupation_id number(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT PK_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -41,7 +41,8 @@ CREATE TABLE tl_job ( ...@@ -41,7 +41,8 @@ CREATE TABLE tl_job (
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
occupation_id number(12) NOT NULL, occupation_id number(12) NOT NULL,
shortened_url_id number(12) NULL, shortened_url_id number(12) NULL,
template_id number(12) NULL template_id number(12) NULL,
job_title_id number(12) NOT NULL
); );
......
...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template (
job_id numeric(12) NULL, job_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- @AutoRun
-- drop table tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
job_title varchar(200) NULL,
occupation_id numeric(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT pk_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -41,7 +41,8 @@ CREATE TABLE tl_job ( ...@@ -41,7 +41,8 @@ CREATE TABLE tl_job (
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL, shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL template_id numeric(12) NULL,
job_title_id numeric(12) NOT NULL
); );
......
...@@ -60,7 +60,8 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -60,7 +60,8 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor
newTemplate.setOccupation(job.getOccupation().getInTransaction(newObjTran)); newTemplate.setOccupation(job.getOccupation().getInTransaction(newObjTran));
newTemplate.setRequireCV(job.getRequireCV()); newTemplate.setRequireCV(job.getRequireCV());
newTemplate.setAssessmentType(job.getAssessmentType()); newTemplate.setAssessmentType(job.getAssessmentType());
newTemplate.setLevel(job.getLevel().getInTransaction(newObjTran)); // newTemplate.setLevel(job.getLevel().getInTransaction(newObjTran));
newTemplate.setILOJobTitle(job.getILOJobTitle().getInTransaction(newObjTran));
for (WorkFlow workflow : job.getWorkFlowsSet()) for (WorkFlow workflow : job.getWorkFlowsSet())
{ {
......
...@@ -3,6 +3,7 @@ package performa.orm; ...@@ -3,6 +3,7 @@ package performa.orm;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter; import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter; import oneit.objstore.rdbms.filters.LessThanFilter;
...@@ -11,6 +12,7 @@ import oneit.utils.CollectionUtils; ...@@ -11,6 +12,7 @@ import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform; import oneit.utils.ObjectTransform;
import oneit.utils.filter.CollectionFilter; import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter; import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException;
import performa.orm.types.AssessmentType; import performa.orm.types.AssessmentType;
import performa.orm.types.CriteriaType; import performa.orm.types.CriteriaType;
...@@ -92,4 +94,19 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate ...@@ -92,4 +94,19 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
{ {
return getAssessmentCriteraByType(criteria).size(); return getAssessmentCriteraByType(criteria).size();
} }
@Override
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
super.postILOJobTitleChange();
}
public Occupation displayOccupation()
{
return getOccupation();
}
} }
\ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" /> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" mandatory="false"/>
</TABLE> </TABLE>
......
...@@ -76,7 +76,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -76,7 +76,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
} }
private String SELECT_COLUMNS = "{PREFIX}tl_assessment_template.object_id as id, {PREFIX}tl_assessment_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_assessment_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_assessment_template.template_name, {PREFIX}tl_assessment_template.job_title, {PREFIX}tl_assessment_template.job_description, {PREFIX}tl_assessment_template.ref_number, {PREFIX}tl_assessment_template.google_address_text, {PREFIX}tl_assessment_template.location_radius, {PREFIX}tl_assessment_template.remote, {PREFIX}tl_assessment_template.job_type, {PREFIX}tl_assessment_template.industry, {PREFIX}tl_assessment_template.require_cv, {PREFIX}tl_assessment_template.assessment_type, {PREFIX}tl_assessment_template.include_assessment_criteria, {PREFIX}tl_assessment_template.level_id, {PREFIX}tl_assessment_template.occupation_id, {PREFIX}tl_assessment_template.job_owner_id, {PREFIX}tl_assessment_template.job_id, {PREFIX}tl_assessment_template.client_id, {PREFIX}tl_assessment_template.hiring_team_id, {PREFIX}tl_assessment_template.company_user_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_assessment_template.object_id as id, {PREFIX}tl_assessment_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_assessment_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_assessment_template.template_name, {PREFIX}tl_assessment_template.job_title, {PREFIX}tl_assessment_template.job_description, {PREFIX}tl_assessment_template.ref_number, {PREFIX}tl_assessment_template.google_address_text, {PREFIX}tl_assessment_template.location_radius, {PREFIX}tl_assessment_template.remote, {PREFIX}tl_assessment_template.job_type, {PREFIX}tl_assessment_template.industry, {PREFIX}tl_assessment_template.require_cv, {PREFIX}tl_assessment_template.assessment_type, {PREFIX}tl_assessment_template.include_assessment_criteria, {PREFIX}tl_assessment_template.level_id, {PREFIX}tl_assessment_template.occupation_id, {PREFIX}tl_assessment_template.job_owner_id, {PREFIX}tl_assessment_template.job_id, {PREFIX}tl_assessment_template.client_id, {PREFIX}tl_assessment_template.hiring_team_id, {PREFIX}tl_assessment_template.company_user_id, {PREFIX}tl_assessment_template.job_title_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -145,7 +145,8 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -145,7 +145,8 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)) !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -215,10 +216,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -215,10 +216,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_assessment_template " + "UPDATE {PREFIX}tl_assessment_template " +
"SET template_name = ?, job_title = ?, job_description = ?, ref_number = ?, google_address_text = ?, location_radius = ?, remote = ?, job_type = ?, industry = ?, require_cv = ?, assessment_type = ?, include_assessment_criteria = ?, level_id = ? , occupation_id = ? , job_owner_id = ? , job_id = ? , client_id = ? , hiring_team_id = ? , company_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET template_name = ?, job_title = ?, job_description = ?, ref_number = ?, google_address_text = ?, location_radius = ?, remote = ?, job_type = ?, industry = ?, require_cv = ?, assessment_type = ?, include_assessment_criteria = ?, level_id = ? , occupation_id = ? , job_owner_id = ? , job_id = ? , client_id = ? , hiring_team_id = ? , company_user_id = ? , job_title_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_assessment_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_assessment_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -494,6 +495,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -494,6 +495,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client, r.getObject ("client_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client, r.getObject ("client_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle, r.getObject ("job_title_id"));
} }
...@@ -510,10 +512,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -510,10 +512,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_assessment_template " + "INSERT INTO {PREFIX}tl_assessment_template " +
" (template_name, job_title, job_description, ref_number, google_address_text, location_radius, remote, job_type, industry, require_cv, assessment_type, include_assessment_criteria, level_id, occupation_id, job_owner_id, job_id, client_id, hiring_team_id, company_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (template_name, job_title, job_description, ref_number, google_address_text, location_radius, remote, job_type, industry, require_cv, assessment_type, include_assessment_criteria, level_id, occupation_id, job_owner_id, job_id, client_id, hiring_team_id, company_user_id, job_title_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))) .listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))) .listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle)))) .listEntry (objectID.longID ()).toList().toArray());
tl_assessment_templatePSet.setStatus (PersistentSetStatus.PROCESSED); tl_assessment_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -62,6 +62,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -62,6 +62,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
public static final String SINGLEREFERENCE_Client = "Client"; public static final String SINGLEREFERENCE_Client = "Client";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam"; public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser"; public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser";
public static final String SINGLEREFERENCE_ILOJobTitle = "ILOJobTitle";
public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias"; public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias";
public static final String BACKREF_AssessmentCriterias = ""; public static final String BACKREF_AssessmentCriterias = "";
public static final String MULTIPLEREFERENCE_WorkFlows = "WorkFlows"; public static final String MULTIPLEREFERENCE_WorkFlows = "WorkFlows";
...@@ -111,6 +112,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -111,6 +112,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
private SingleAssociation<AssessmentCriteriaTemplate, Client> _Client; private SingleAssociation<AssessmentCriteriaTemplate, Client> _Client;
private SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> _HiringTeam; private SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> _HiringTeam;
private SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> _CompanyUser; private SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> _CompanyUser;
private SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> _ILOJobTitle;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -159,6 +161,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -159,6 +161,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
setupAssocMetaData_Client(); setupAssocMetaData_Client();
setupAssocMetaData_HiringTeam(); setupAssocMetaData_HiringTeam();
setupAssocMetaData_CompanyUser(); setupAssocMetaData_CompanyUser();
setupAssocMetaData_ILOJobTitle();
FIELD_OccupationId_Validators = (AttributeValidator[])setupAttribMetaData_OccupationId(validatorMapping).toArray (new AttributeValidator[0]); FIELD_OccupationId_Validators = (AttributeValidator[])setupAttribMetaData_OccupationId(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]); FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]); FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -317,6 +320,21 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -317,6 +320,21 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ILOJobTitle()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title_id");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "ILOJobTitle");
metaInfo.put ("type", "ILOJobTitle");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for AssessmentCriteriaTemplate.ILOJobTitle:", metaInfo);
ATTRIBUTES_METADATA_AssessmentCriteriaTemplate.put (SINGLEREFERENCE_ILOJobTitle, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_OccupationId(Map validatorMapping) private static List setupAttribMetaData_OccupationId(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -625,6 +643,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -625,6 +643,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template"); _Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template");
_HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template"); _HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template");
_CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template"); _CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template");
_ILOJobTitle = new SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_assessment_template");
_AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow); _WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow);
...@@ -643,6 +662,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -643,6 +662,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template"); _Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template");
_HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template"); _HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template");
_CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template"); _CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template");
_ILOJobTitle = new SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_assessment_template");
_AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow); _WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow);
...@@ -1956,6 +1976,8 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -1956,6 +1976,8 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
result.add("CompanyUser"); result.add("CompanyUser");
result.add("ILOJobTitle");
return result; return result;
} }
...@@ -1988,6 +2010,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -1988,6 +2010,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return _CompanyUser.getReferencedType (); return _CompanyUser.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return _ILOJobTitle.getReferencedType ();
} }
else else
{ {
...@@ -2023,6 +2048,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2023,6 +2048,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return null ;
} }
else else
{ {
...@@ -2058,6 +2086,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2058,6 +2086,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (); return getCompanyUser ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle ();
} }
else else
{ {
...@@ -2093,6 +2124,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2093,6 +2124,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (getType); return getCompanyUser (getType);
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle (getType);
} }
else else
{ {
...@@ -2128,6 +2162,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2128,6 +2162,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUserID (); return getCompanyUserID ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitleID ();
} }
else else
{ {
...@@ -2163,6 +2200,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2163,6 +2200,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
setCompanyUser ((CompanyUser)(newValue)); setCompanyUser ((CompanyUser)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
setILOJobTitle ((ILOJobTitle)(newValue));
} }
else else
{ {
...@@ -2832,6 +2872,100 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2832,6 +2872,100 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
} }
/** /**
* Get the reference ILOJobTitle
*/
public ILOJobTitle getILOJobTitle () throws StorageException
{
assertValid();
try
{
return (ILOJobTitle)(_ILOJobTitle.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in AssessmentCriteriaTemplate:", this.getObjectID (), ", was trying to get ILOJobTitle:", getILOJobTitleID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ILOJobTitle.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public ILOJobTitle getILOJobTitle (Get getType) throws StorageException
{
assertValid();
return _ILOJobTitle.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
assertValid();
if (_ILOJobTitle == null)
{
return null;
}
else
{
return _ILOJobTitle.getID ();
}
}
/**
* Called prior to the assoc 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 preILOJobTitleChange (ILOJobTitle newILOJobTitle) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postILOJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_ILOJobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ILOJobTitle. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setILOJobTitle (ILOJobTitle newILOJobTitle) throws StorageException, FieldException
{
if (_ILOJobTitle.wouldReferencedChange (newILOJobTitle))
{
assertValid();
Debug.assertion (getWriteability_ILOJobTitle () != FieldWriteability.FALSE, "Assoc ILOJobTitle is not writeable");
preILOJobTitleChange (newILOJobTitle);
_ILOJobTitle.set (newILOJobTitle);
postILOJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings. * A list of multi assoc names e.g. list of strings.
*/ */
public List<String> getMultiAssocs() public List<String> getMultiAssocs()
...@@ -3252,6 +3386,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3252,6 +3386,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.getPersistentSets (allSets); _Client.getPersistentSets (allSets);
_HiringTeam.getPersistentSets (allSets); _HiringTeam.getPersistentSets (allSets);
_CompanyUser.getPersistentSets (allSets); _CompanyUser.getPersistentSets (allSets);
_ILOJobTitle.getPersistentSets (allSets);
} }
...@@ -3285,6 +3420,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3285,6 +3420,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.setFromPersistentSets (objectID, allSets); _Client.setFromPersistentSets (objectID, allSets);
_HiringTeam.setFromPersistentSets (objectID, allSets); _HiringTeam.setFromPersistentSets (objectID, allSets);
_CompanyUser.setFromPersistentSets (objectID, allSets); _CompanyUser.setFromPersistentSets (objectID, allSets);
_ILOJobTitle.setFromPersistentSets (objectID, allSets);
} }
...@@ -3459,6 +3595,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3459,6 +3595,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.copyFrom (sourceAssessmentCriteriaTemplate._Client, linkToGhosts); _Client.copyFrom (sourceAssessmentCriteriaTemplate._Client, linkToGhosts);
_HiringTeam.copyFrom (sourceAssessmentCriteriaTemplate._HiringTeam, linkToGhosts); _HiringTeam.copyFrom (sourceAssessmentCriteriaTemplate._HiringTeam, linkToGhosts);
_CompanyUser.copyFrom (sourceAssessmentCriteriaTemplate._CompanyUser, linkToGhosts); _CompanyUser.copyFrom (sourceAssessmentCriteriaTemplate._CompanyUser, linkToGhosts);
_ILOJobTitle.copyFrom (sourceAssessmentCriteriaTemplate._ILOJobTitle, linkToGhosts);
} }
} }
...@@ -3519,6 +3656,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3519,6 +3656,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.readExternalData(vals.get(SINGLEREFERENCE_Client)); _Client.readExternalData(vals.get(SINGLEREFERENCE_Client));
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam)); _HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
_CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser)); _CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser));
_ILOJobTitle.readExternalData(vals.get(SINGLEREFERENCE_ILOJobTitle));
_AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias)); _AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias));
_WorkFlows.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlows)); _WorkFlows.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlows));
...@@ -3552,6 +3690,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3552,6 +3690,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData()); vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData());
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData()); vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData()); vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData());
vals.put (SINGLEREFERENCE_ILOJobTitle, _ILOJobTitle.writeExternalData());
vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData());
vals.put (MULTIPLEREFERENCE_WorkFlows, _WorkFlows.writeExternalData()); vals.put (MULTIPLEREFERENCE_WorkFlows, _WorkFlows.writeExternalData());
...@@ -3624,6 +3763,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3624,6 +3763,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.compare (otherAssessmentCriteriaTemplate._Client, listener); _Client.compare (otherAssessmentCriteriaTemplate._Client, listener);
_HiringTeam.compare (otherAssessmentCriteriaTemplate._HiringTeam, listener); _HiringTeam.compare (otherAssessmentCriteriaTemplate._HiringTeam, listener);
_CompanyUser.compare (otherAssessmentCriteriaTemplate._CompanyUser, listener); _CompanyUser.compare (otherAssessmentCriteriaTemplate._CompanyUser, listener);
_ILOJobTitle.compare (otherAssessmentCriteriaTemplate._ILOJobTitle, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -3666,6 +3806,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3666,6 +3806,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
visitor.visitAssociation (_Client); visitor.visitAssociation (_Client);
visitor.visitAssociation (_HiringTeam); visitor.visitAssociation (_HiringTeam);
visitor.visitAssociation (_CompanyUser); visitor.visitAssociation (_CompanyUser);
visitor.visitAssociation (_ILOJobTitle);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_WorkFlows); visitor.visitAssociation (_WorkFlows);
...@@ -3704,6 +3845,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3704,6 +3845,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
visitor.visit (_CompanyUser); visitor.visit (_CompanyUser);
} }
if (scope.includes (_ILOJobTitle))
{
visitor.visit (_ILOJobTitle);
}
if (scope.includes (_AssessmentCriterias)) if (scope.includes (_AssessmentCriterias))
{ {
visitor.visit (_AssessmentCriterias); visitor.visit (_AssessmentCriterias);
...@@ -3813,6 +3958,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3813,6 +3958,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return filter.matches (getCompanyUser ()); return filter.matches (getCompanyUser ());
} }
else if (attribName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return filter.matches (getILOJobTitle ());
}
else else
{ {
return super.testFilter (attribName, filter); return super.testFilter (attribName, filter);
...@@ -3958,6 +4107,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3958,6 +4107,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
return this; return this;
} }
public SearchAll andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_assessment_template.job_title_id", "ILOJobTitle");
return this;
}
public AssessmentCriteriaTemplate[] public AssessmentCriteriaTemplate[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -4279,6 +4434,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4279,6 +4434,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return getWriteability_CompanyUser (); return getWriteability_CompanyUser ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getWriteability_ILOJobTitle ();
}
else if (fieldName.equals (FIELD_OccupationId)) else if (fieldName.equals (FIELD_OccupationId))
{ {
return getWriteability_OccupationId (); return getWriteability_OccupationId ();
...@@ -4804,6 +4963,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4804,6 +4963,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return toCompanyUser (); return toCompanyUser ();
} }
if (name.equals ("ILOJobTitle"))
{
return toILOJobTitle ();
}
return super.to(name); return super.to(name);
...@@ -4877,6 +5040,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4877,6 +5040,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter)); return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter));
} }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle () { return toILOJobTitle (Filter.ALL); }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle (Filter<ILOJobTitle> filter)
{
return ILOJobTitle.REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<From, ILOJobTitle> (this, new ORMSingleAssocPipe<Me, ILOJobTitle>(SINGLEREFERENCE_ILOJobTitle, filter));
}
public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias () { return toAssessmentCriterias(Filter.ALL); } public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias () { return toAssessmentCriterias(Filter.ALL); }
public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias (Filter<AssessmentCriteria> filter) public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias (Filter<AssessmentCriteria> filter)
...@@ -5023,6 +5192,20 @@ class DummyAssessmentCriteriaTemplate extends AssessmentCriteriaTemplate ...@@ -5023,6 +5192,20 @@ class DummyAssessmentCriteriaTemplate extends AssessmentCriteriaTemplate
return CompanyUser.DUMMY_CompanyUser.getObjectID(); return CompanyUser.DUMMY_CompanyUser.getObjectID();
} }
public ILOJobTitle getILOJobTitle () throws StorageException
{
return (ILOJobTitle)(ILOJobTitle.DUMMY_ILOJobTitle);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
return ILOJobTitle.DUMMY_ILOJobTitle.getObjectID();
}
public int getAssessmentCriteriasCount () throws StorageException public int getAssessmentCriteriasCount () throws StorageException
{ {
return 0; return 0;
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseILOJobTitle extends BaseBusinessClass
{
// Reference instance for the object
public static final ILOJobTitle REFERENCE_ILOJobTitle = new ILOJobTitle ();
// Reference instance for the object
public static final ILOJobTitle DUMMY_ILOJobTitle = new DummyILOJobTitle ();
// Static constants corresponding to field names
public static final String FIELD_JobTitle = "JobTitle";
public static final String SINGLEREFERENCE_Occupation = "Occupation";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<ILOJobTitle> HELPER_JobTitle = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _JobTitle;
// Private attributes corresponding to single references
private SingleAssociation<ILOJobTitle, Occupation> _Occupation;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_ILOJobTitle = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_JobTitle_Validators;
// Arrays of behaviour decorators
private static final ILOJobTitleBehaviourDecorator[] ILOJobTitle_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_Occupation();
FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_ILOJobTitle.initialiseReference ();
DUMMY_ILOJobTitle.initialiseReference ();
ILOJobTitle_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(ILOJobTitle.class).toArray(new ILOJobTitleBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_Occupation()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "occupation_id");
metaInfo.put ("name", "Occupation");
metaInfo.put ("type", "Occupation");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ILOJobTitle.Occupation:", metaInfo);
ATTRIBUTES_METADATA_ILOJobTitle.put (SINGLEREFERENCE_Occupation, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_JobTitle(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title");
metaInfo.put ("length", "200");
metaInfo.put ("name", "JobTitle");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ILOJobTitle.JobTitle:", metaInfo);
ATTRIBUTES_METADATA_ILOJobTitle.put (FIELD_JobTitle, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ILOJobTitle.class, "JobTitle", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ILOJobTitle.JobTitle:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseILOJobTitle ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return ILOJobTitle_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_JobTitle = (String)(HELPER_JobTitle.initialise (_JobTitle));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_Occupation = new SingleAssociation<ILOJobTitle, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_ilo_job_title");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_Occupation = new SingleAssociation<ILOJobTitle, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_ilo_job_title");
return this;
}
/**
* Get the attribute JobTitle
*/
public String getJobTitle ()
{
assertValid();
String valToReturn = _JobTitle;
for (ILOJobTitleBehaviourDecorator bhd : ILOJobTitle_BehaviourDecorators)
{
valToReturn = bhd.getJobTitle ((ILOJobTitle)this, valToReturn);
}
return valToReturn;
}
/**
* 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 preJobTitleChange (String newJobTitle) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_JobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute JobTitle. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setJobTitle (String newJobTitle) throws FieldException
{
boolean oldAndNewIdentical = HELPER_JobTitle.compare (_JobTitle, newJobTitle);
try
{
for (ILOJobTitleBehaviourDecorator bhd : ILOJobTitle_BehaviourDecorators)
{
newJobTitle = bhd.setJobTitle ((ILOJobTitle)this, newJobTitle);
oldAndNewIdentical = HELPER_JobTitle.compare (_JobTitle, newJobTitle);
}
if (FIELD_JobTitle_Validators.length > 0)
{
Object newJobTitleObj = HELPER_JobTitle.toObject (newJobTitle);
if (newJobTitleObj != null)
{
int loopMax = FIELD_JobTitle_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ILOJobTitle.get (FIELD_JobTitle);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_JobTitle_Validators[v].checkAttribute (this, FIELD_JobTitle, metadata, newJobTitleObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_JobTitle () != FieldWriteability.FALSE, "Field JobTitle is not writeable");
preJobTitleChange (newJobTitle);
markFieldChange (FIELD_JobTitle);
_JobTitle = newJobTitle;
postFieldChange (FIELD_JobTitle);
postJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("Occupation");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return _Occupation.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return null ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupation ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupation (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupationID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
setOccupation ((Occupation)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference Occupation
*/
public Occupation getOccupation () throws StorageException
{
assertValid();
try
{
return (Occupation)(_Occupation.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in ILOJobTitle:", this.getObjectID (), ", was trying to get Occupation:", getOccupationID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Occupation.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Occupation getOccupation (Get getType) throws StorageException
{
assertValid();
return _Occupation.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getOccupationID ()
{
assertValid();
if (_Occupation == null)
{
return null;
}
else
{
return _Occupation.getID ();
}
}
/**
* Called prior to the assoc 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 preOccupationChange (Occupation newOccupation) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postOccupationChange () throws FieldException
{
}
public FieldWriteability getWriteability_Occupation ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference Occupation. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setOccupation (Occupation newOccupation) throws StorageException, FieldException
{
if (_Occupation.wouldReferencedChange (newOccupation))
{
assertValid();
Debug.assertion (getWriteability_Occupation () != FieldWriteability.FALSE, "Assoc Occupation is not writeable");
preOccupationChange (newOccupation);
_Occupation.set (newOccupation);
postOccupationChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public ILOJobTitle newInstance ()
{
return new ILOJobTitle ();
}
public ILOJobTitle referenceInstance ()
{
return REFERENCE_ILOJobTitle;
}
public ILOJobTitle getInTransaction (ObjectTransaction t) throws StorageException
{
return getILOJobTitleByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_ILOJobTitle;
}
public String getBaseSetName ()
{
return "tl_ilo_job_title";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_ilo_job_titlePSet = allSets.getPersistentSet (myID, "tl_ilo_job_title", myPSetStatus);
tl_ilo_job_titlePSet.setAttrib (FIELD_ObjectID, myID);
tl_ilo_job_titlePSet.setAttrib (FIELD_JobTitle, HELPER_JobTitle.toObject (_JobTitle)); //
_Occupation.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_ilo_job_titlePSet = allSets.getPersistentSet (objectID, "tl_ilo_job_title");
_JobTitle = (String)(HELPER_JobTitle.fromObject (_JobTitle, tl_ilo_job_titlePSet.getAttrib (FIELD_JobTitle))); //
_Occupation.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof ILOJobTitle)
{
ILOJobTitle otherILOJobTitle = (ILOJobTitle)other;
try
{
setJobTitle (otherILOJobTitle.getJobTitle ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
_JobTitle = sourceILOJobTitle._JobTitle;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
_Occupation.copyFrom (sourceILOJobTitle._Occupation, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_JobTitle = (String)(HELPER_JobTitle.readExternal (_JobTitle, vals.get(FIELD_JobTitle))); //
_Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_JobTitle, HELPER_JobTitle.writeExternal (_JobTitle));
vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseILOJobTitle)
{
BaseILOJobTitle otherILOJobTitle = (BaseILOJobTitle)(other);
if (!HELPER_JobTitle.compare(this._JobTitle, otherILOJobTitle._JobTitle))
{
listener.notifyFieldChange(this, other, FIELD_JobTitle, HELPER_JobTitle.toObject(this._JobTitle), HELPER_JobTitle.toObject(otherILOJobTitle._JobTitle));
}
// Compare single assocs
_Occupation.compare (otherILOJobTitle._Occupation, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_JobTitle, HELPER_JobTitle.toObject(getJobTitle()));
visitor.visitAssociation (_Occupation);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_Occupation))
{
visitor.visit (_Occupation);
}
}
public static ILOJobTitle createILOJobTitle (ObjectTransaction transaction) throws StorageException
{
ILOJobTitle result = new ILOJobTitle ();
result.initialiseNewObject (transaction);
return result;
}
public static ILOJobTitle getILOJobTitleByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (ILOJobTitle)(transaction.getObjectByID (REFERENCE_ILOJobTitle, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return filter.matches (getJobTitle ());
}
else if (attribName.equals (SINGLEREFERENCE_Occupation))
{
return filter.matches (getOccupation ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<ILOJobTitle>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andJobTitle (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_ilo_job_title.job_title", "JobTitle");
return this;
}
public SearchAll andOccupation (QueryFilter<Occupation> filter)
{
filter.addFilter (context, "tl_ilo_job_title.occupation_id", "Occupation");
return this;
}
public ILOJobTitle[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_ILOJobTitle, SEARCH_All, criteria);
Set<ILOJobTitle> typedResults = new LinkedHashSet <ILOJobTitle> ();
for (BaseBusinessClass bbcResult : results)
{
ILOJobTitle aResult = (ILOJobTitle)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ILOJobTitle[0]);
}
}
public static ILOJobTitle[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return HELPER_JobTitle.toObject (getJobTitle ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return HELPER_JobTitle;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
setJobTitle ((String)(HELPER_JobTitle.fromObject (_JobTitle, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_JobTitle))
{
return getWriteability_JobTitle ();
}
else if (fieldName.equals (SINGLEREFERENCE_Occupation))
{
return getWriteability_Occupation ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_JobTitle () != FieldWriteability.TRUE)
{
fields.add (FIELD_JobTitle);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_JobTitle.getAttribObject (getClass (), _JobTitle, false, FIELD_JobTitle));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_ILOJobTitle.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_ILOJobTitle.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_ILOJobTitle.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_ILOJobTitle.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class ILOJobTitleBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<ILOJobTitle>
{
/**
* Get the attribute JobTitle
*/
public String getJobTitle (ILOJobTitle obj, String original)
{
return original;
}
/**
* Change the value set for attribute JobTitle.
* May modify the field beforehand
* Occurs before validation.
*/
public String setJobTitle (ILOJobTitle obj, String newJobTitle) throws FieldException
{
return newJobTitle;
}
}
public ORMPipeLine pipes()
{
return new ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> ((ILOJobTitle)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipelineILOJobTitle()
{
return (ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle>) pipes();
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle(Collection<ILOJobTitle> items)
{
return REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> (items);
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle(ILOJobTitle[] _items)
{
return pipesILOJobTitle(Arrays.asList (_items));
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle()
{
return pipesILOJobTitle((Collection)null);
}
public class ILOJobTitlePipeLineFactory<From extends BaseBusinessClass, Me extends ILOJobTitle> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> ILOJobTitlePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ILOJobTitlePipeLineFactory (From seed)
{
super(seed);
}
public ILOJobTitlePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("JobTitle"))
{
return toJobTitle ();
}
if (name.equals ("Occupation"))
{
return toOccupation ();
}
return super.to(name);
}
public PipeLine<From, String> toJobTitle () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobTitle)); }
public Occupation.OccupationPipeLineFactory<From, Occupation> toOccupation () { return toOccupation (Filter.ALL); }
public Occupation.OccupationPipeLineFactory<From, Occupation> toOccupation (Filter<Occupation> filter)
{
return Occupation.REFERENCE_Occupation.new OccupationPipeLineFactory<From, Occupation> (this, new ORMSingleAssocPipe<Me, Occupation>(SINGLEREFERENCE_Occupation, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyILOJobTitle extends ILOJobTitle
{
// Default constructor primarily to support Externalisable
public DummyILOJobTitle()
{
super();
}
public void assertValid ()
{
}
public Occupation getOccupation () throws StorageException
{
return (Occupation)(Occupation.DUMMY_Occupation);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getOccupationID ()
{
return Occupation.DUMMY_Occupation.getObjectID();
}
}
...@@ -94,6 +94,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -94,6 +94,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String SINGLEREFERENCE_Occupation = "Occupation"; public static final String SINGLEREFERENCE_Occupation = "Occupation";
public static final String SINGLEREFERENCE_ShortenedURL = "ShortenedURL"; public static final String SINGLEREFERENCE_ShortenedURL = "ShortenedURL";
public static final String SINGLEREFERENCE_AssessmentTemplate = "AssessmentTemplate"; public static final String SINGLEREFERENCE_AssessmentTemplate = "AssessmentTemplate";
public static final String SINGLEREFERENCE_ILOJobTitle = "ILOJobTitle";
public static final String MULTIPLEREFERENCE_JobApplications = "JobApplications"; public static final String MULTIPLEREFERENCE_JobApplications = "JobApplications";
public static final String BACKREF_JobApplications = ""; public static final String BACKREF_JobApplications = "";
public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias"; public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias";
...@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass
private SingleAssociation<Job, Occupation> _Occupation; private SingleAssociation<Job, Occupation> _Occupation;
private SingleAssociation<Job, ShortenedURL> _ShortenedURL; private SingleAssociation<Job, ShortenedURL> _ShortenedURL;
private SingleAssociation<Job, AssessmentCriteriaTemplate> _AssessmentTemplate; private SingleAssociation<Job, AssessmentCriteriaTemplate> _AssessmentTemplate;
private SingleAssociation<Job, ILOJobTitle> _ILOJobTitle;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -294,6 +296,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -294,6 +296,7 @@ public abstract class BaseJob extends BaseBusinessClass
setupAssocMetaData_Occupation(); setupAssocMetaData_Occupation();
setupAssocMetaData_ShortenedURL(); setupAssocMetaData_ShortenedURL();
setupAssocMetaData_AssessmentTemplate(); setupAssocMetaData_AssessmentTemplate();
setupAssocMetaData_ILOJobTitle();
FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -559,6 +562,21 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -559,6 +562,21 @@ public abstract class BaseJob extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ILOJobTitle()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ILOJobTitle");
metaInfo.put ("type", "ILOJobTitle");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.ILOJobTitle:", metaInfo);
ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_ILOJobTitle, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Email(Map validatorMapping) private static List setupAttribMetaData_Email(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -1390,6 +1408,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1390,6 +1408,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job"); _Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job"); _ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job");
_AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job"); _AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job");
_ILOJobTitle = new SingleAssociation<Job, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_job");
_JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication); _JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication);
_AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria); _CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria);
...@@ -1414,6 +1433,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1414,6 +1433,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job"); _Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job"); _ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job");
_AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job"); _AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job");
_ILOJobTitle = new SingleAssociation<Job, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_job");
_JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication); _JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication);
_AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria); _CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria);
...@@ -5384,6 +5404,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5384,6 +5404,8 @@ public abstract class BaseJob extends BaseBusinessClass
result.add("AssessmentTemplate"); result.add("AssessmentTemplate");
result.add("ILOJobTitle");
return result; return result;
} }
...@@ -5428,6 +5450,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5428,6 +5450,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return _AssessmentTemplate.getReferencedType (); return _AssessmentTemplate.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return _ILOJobTitle.getReferencedType ();
} }
else else
{ {
...@@ -5466,6 +5491,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5466,6 +5491,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return null ;
} }
else else
{ {
...@@ -5513,6 +5541,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5513,6 +5541,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplate (); return getAssessmentTemplate ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle ();
} }
else else
{ {
...@@ -5560,6 +5591,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5560,6 +5591,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplate (getType); return getAssessmentTemplate (getType);
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle (getType);
} }
else else
{ {
...@@ -5607,6 +5641,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5607,6 +5641,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplateID (); return getAssessmentTemplateID ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitleID ();
} }
else else
{ {
...@@ -5654,6 +5691,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5654,6 +5691,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
setAssessmentTemplate ((AssessmentCriteriaTemplate)(newValue)); setAssessmentTemplate ((AssessmentCriteriaTemplate)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
setILOJobTitle ((ILOJobTitle)(newValue));
} }
else else
{ {
...@@ -6712,6 +6752,101 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6712,6 +6752,101 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the reference ILOJobTitle
*/
public ILOJobTitle getILOJobTitle () throws StorageException
{
assertValid();
try
{
return (ILOJobTitle)(_ILOJobTitle.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get ILOJobTitle:", getILOJobTitleID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ILOJobTitle.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public ILOJobTitle getILOJobTitle (Get getType) throws StorageException
{
assertValid();
return _ILOJobTitle.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
assertValid();
if (_ILOJobTitle == null)
{
return null;
}
else
{
return _ILOJobTitle.getID ();
}
}
/**
* Called prior to the assoc 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 preILOJobTitleChange (ILOJobTitle newILOJobTitle) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postILOJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_ILOJobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ILOJobTitle. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setILOJobTitle (ILOJobTitle newILOJobTitle) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newILOJobTitle != null, this, SINGLEREFERENCE_ILOJobTitle, "mandatory");
if (_ILOJobTitle.wouldReferencedChange (newILOJobTitle))
{
assertValid();
Debug.assertion (getWriteability_ILOJobTitle () != FieldWriteability.FALSE, "Assoc ILOJobTitle is not writeable");
preILOJobTitleChange (newILOJobTitle);
_ILOJobTitle.set (newILOJobTitle);
postILOJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings. * A list of multi assoc names e.g. list of strings.
*/ */
public List<String> getMultiAssocs() public List<String> getMultiAssocs()
...@@ -7404,6 +7539,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7404,6 +7539,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.getPersistentSets (allSets); _Occupation.getPersistentSets (allSets);
_ShortenedURL.getPersistentSets (allSets); _ShortenedURL.getPersistentSets (allSets);
_AssessmentTemplate.getPersistentSets (allSets); _AssessmentTemplate.getPersistentSets (allSets);
_ILOJobTitle.getPersistentSets (allSets);
} }
...@@ -7451,6 +7587,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7451,6 +7587,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.setFromPersistentSets (objectID, allSets); _Occupation.setFromPersistentSets (objectID, allSets);
_ShortenedURL.setFromPersistentSets (objectID, allSets); _ShortenedURL.setFromPersistentSets (objectID, allSets);
_AssessmentTemplate.setFromPersistentSets (objectID, allSets); _AssessmentTemplate.setFromPersistentSets (objectID, allSets);
_ILOJobTitle.setFromPersistentSets (objectID, allSets);
} }
...@@ -7773,6 +7910,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7773,6 +7910,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.copyFrom (sourceJob._Occupation, linkToGhosts); _Occupation.copyFrom (sourceJob._Occupation, linkToGhosts);
_ShortenedURL.copyFrom (sourceJob._ShortenedURL, linkToGhosts); _ShortenedURL.copyFrom (sourceJob._ShortenedURL, linkToGhosts);
_AssessmentTemplate.copyFrom (sourceJob._AssessmentTemplate, linkToGhosts); _AssessmentTemplate.copyFrom (sourceJob._AssessmentTemplate, linkToGhosts);
_ILOJobTitle.copyFrom (sourceJob._ILOJobTitle, linkToGhosts);
} }
} }
...@@ -7805,6 +7943,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7805,6 +7943,8 @@ public abstract class BaseJob extends BaseBusinessClass
context.check (getOccupationID() != null, this, SINGLEREFERENCE_Occupation, "mandatory"); context.check (getOccupationID() != null, this, SINGLEREFERENCE_Occupation, "mandatory");
context.check (getILOJobTitleID() != null, this, SINGLEREFERENCE_ILOJobTitle, "mandatory");
} }
...@@ -7866,6 +8006,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7866,6 +8006,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation)); _Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation));
_ShortenedURL.readExternalData(vals.get(SINGLEREFERENCE_ShortenedURL)); _ShortenedURL.readExternalData(vals.get(SINGLEREFERENCE_ShortenedURL));
_AssessmentTemplate.readExternalData(vals.get(SINGLEREFERENCE_AssessmentTemplate)); _AssessmentTemplate.readExternalData(vals.get(SINGLEREFERENCE_AssessmentTemplate));
_ILOJobTitle.readExternalData(vals.get(SINGLEREFERENCE_ILOJobTitle));
_JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications)); _JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications));
_AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias)); _AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias));
_CultureCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_CultureCriterias)); _CultureCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_CultureCriterias));
...@@ -7932,6 +8073,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7932,6 +8073,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData()); vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData());
vals.put (SINGLEREFERENCE_ShortenedURL, _ShortenedURL.writeExternalData()); vals.put (SINGLEREFERENCE_ShortenedURL, _ShortenedURL.writeExternalData());
vals.put (SINGLEREFERENCE_AssessmentTemplate, _AssessmentTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_AssessmentTemplate, _AssessmentTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_ILOJobTitle, _ILOJobTitle.writeExternalData());
vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData()); vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData());
vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData());
vals.put (MULTIPLEREFERENCE_CultureCriterias, _CultureCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_CultureCriterias, _CultureCriterias.writeExternalData());
...@@ -8062,6 +8204,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8062,6 +8204,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.compare (otherJob._Occupation, listener); _Occupation.compare (otherJob._Occupation, listener);
_ShortenedURL.compare (otherJob._ShortenedURL, listener); _ShortenedURL.compare (otherJob._ShortenedURL, listener);
_AssessmentTemplate.compare (otherJob._AssessmentTemplate, listener); _AssessmentTemplate.compare (otherJob._AssessmentTemplate, listener);
_ILOJobTitle.compare (otherJob._ILOJobTitle, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -8137,6 +8280,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8137,6 +8280,7 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitAssociation (_Occupation); visitor.visitAssociation (_Occupation);
visitor.visitAssociation (_ShortenedURL); visitor.visitAssociation (_ShortenedURL);
visitor.visitAssociation (_AssessmentTemplate); visitor.visitAssociation (_AssessmentTemplate);
visitor.visitAssociation (_ILOJobTitle);
visitor.visitAssociation (_JobApplications); visitor.visitAssociation (_JobApplications);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_CultureCriterias); visitor.visitAssociation (_CultureCriterias);
...@@ -8193,6 +8337,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8193,6 +8337,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
visitor.visit (_AssessmentTemplate); visitor.visit (_AssessmentTemplate);
} }
if (scope.includes (_ILOJobTitle))
{
visitor.visit (_ILOJobTitle);
}
if (scope.includes (_JobApplications)) if (scope.includes (_JobApplications))
{ {
visitor.visit (_JobApplications); visitor.visit (_JobApplications);
...@@ -8366,6 +8514,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8366,6 +8514,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return filter.matches (getAssessmentTemplate ()); return filter.matches (getAssessmentTemplate ());
} }
else if (attribName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return filter.matches (getILOJobTitle ());
}
else else
{ {
return super.testFilter (attribName, filter); return super.testFilter (attribName, filter);
...@@ -8595,6 +8747,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8595,6 +8747,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchAll andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -8856,6 +9014,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8856,6 +9014,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchJobKey andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job search (ObjectTransaction transaction) throws StorageException public Job search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -9111,6 +9275,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9111,6 +9275,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchCompany andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -9367,6 +9537,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9367,6 +9537,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchDetails andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -10077,6 +10253,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10077,6 +10253,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return getWriteability_AssessmentTemplate (); return getWriteability_AssessmentTemplate ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getWriteability_ILOJobTitle ();
}
else if (fieldName.equals (FIELD_Email)) else if (fieldName.equals (FIELD_Email))
{ {
return getWriteability_Email (); return getWriteability_Email ();
...@@ -11450,6 +11630,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11450,6 +11630,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return toAssessmentTemplate (); return toAssessmentTemplate ();
} }
if (name.equals ("ILOJobTitle"))
{
return toILOJobTitle ();
}
return super.to(name); return super.to(name);
...@@ -11601,6 +11785,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11601,6 +11785,12 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate.new AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> (this, new ORMSingleAssocPipe<Me, AssessmentCriteriaTemplate>(SINGLEREFERENCE_AssessmentTemplate, filter)); return AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate.new AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> (this, new ORMSingleAssocPipe<Me, AssessmentCriteriaTemplate>(SINGLEREFERENCE_AssessmentTemplate, filter));
} }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle () { return toILOJobTitle (Filter.ALL); }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle (Filter<ILOJobTitle> filter)
{
return ILOJobTitle.REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<From, ILOJobTitle> (this, new ORMSingleAssocPipe<Me, ILOJobTitle>(SINGLEREFERENCE_ILOJobTitle, filter));
}
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); } public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter) public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter)
...@@ -11900,6 +12090,20 @@ class DummyJob extends Job ...@@ -11900,6 +12090,20 @@ class DummyJob extends Job
return AssessmentCriteriaTemplate.DUMMY_AssessmentCriteriaTemplate.getObjectID(); return AssessmentCriteriaTemplate.DUMMY_AssessmentCriteriaTemplate.getObjectID();
} }
public ILOJobTitle getILOJobTitle () throws StorageException
{
return (ILOJobTitle)(ILOJobTitle.DUMMY_ILOJobTitle);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
return ILOJobTitle.DUMMY_ILOJobTitle.getObjectID();
}
public int getJobApplicationsCount () throws StorageException public int getJobApplicationsCount () throws StorageException
{ {
return 0; return 0;
......
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
public class ILOJobTitle extends BaseILOJobTitle
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public ILOJobTitle ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public String getToString()
{
return StringUtils.subNulls(getJobTitle(), super.getToString());
}
}
<?xml version="1.0"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="ILOJobTitle" package="performa.orm">
<IMPORT value="performa.orm.types.*" />
<TABLE name="tl_ilo_job_title" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="200" />
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" />
</TABLE>
<SEARCH type="All" paramFilter="object_id is not null" orderBy="object_id"/>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class ILOJobTitlePersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea ILOJobTitlePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "ILOJobTitle");
// Private attributes corresponding to business object data
private String dummyJobTitle;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_JobTitle = DefaultAttributeHelper.INSTANCE;
public ILOJobTitlePersistenceMgr ()
{
dummyJobTitle = (String)(HELPER_JobTitle.initialise (dummyJobTitle));
}
private String SELECT_COLUMNS = "{PREFIX}tl_ilo_job_title.object_id as id, {PREFIX}tl_ilo_job_title.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_ilo_job_title.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_ilo_job_title.job_title, {PREFIX}tl_ilo_job_title.occupation_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, ILOJobTitle.REFERENCE_ILOJobTitle);
if (objectToReturn instanceof ILOJobTitle)
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a ILOJobTitle");
}
}
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(id, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_ilo_job_titlePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_ilo_job_titlePSet.containsAttrib(ILOJobTitle.FIELD_JobTitle)||
!tl_ilo_job_titlePSet.containsAttrib(ILOJobTitle.SINGLEREFERENCE_Occupation))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
ILOJobTitle result = new ILOJobTitle ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_ilo_job_title " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_ilo_job_title.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_ilo_job_title " +
"SET job_title = ?, occupation_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_ilo_job_title.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.FIELD_JobTitle))).listEntry (SQLManager.CheckNull((Long)(tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.SINGLEREFERENCE_Occupation)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_ilo_job_title WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_ilo_job_title", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (ILOJobTitlePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_ilo_job_title");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_ilo_job_title for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (ILOJobTitlePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_ilo_job_title " +
"WHERE tl_ilo_job_title.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_ilo_job_title WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_ilo_job_title");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_ilo_job_title for row:" + objectID;
LogMgr.log (ILOJobTitlePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, ILOJobTitle> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (ILOJobTitle.REFERENCE_ILOJobTitle.getObjectIDSpace (), r.getLong ("id"));
ILOJobTitle resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, ILOJobTitle.REFERENCE_ILOJobTitle);
if (cachedElement instanceof ILOJobTitle)
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (ILOJobTitle)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a ILOJobTitle");
}
}
else
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new ILOJobTitle ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_ilo_job_title " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (ILOJobTitle.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: object_id is not null
String preFilter = "(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}tl_ilo_job_title " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
// Object Modified
tl_ilo_job_titlePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_ilo_job_titlePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_ilo_job_titlePSet.setAttrib(ILOJobTitle.FIELD_JobTitle, HELPER_JobTitle.getFromRS(dummyJobTitle, r, "job_title"));
tl_ilo_job_titlePSet.setAttrib(ILOJobTitle.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_ilo_job_title " +
" (job_title, occupation_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.FIELD_JobTitle))) .listEntry (SQLManager.CheckNull((Long)(tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.SINGLEREFERENCE_Occupation)))) .listEntry (objectID.longID ()).toList().toArray());
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -719,4 +719,19 @@ public class Job extends BaseJob ...@@ -719,4 +719,19 @@ public class Job extends BaseJob
return sb.toString(); return sb.toString();
} }
@Override
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
super.postILOJobTitleChange();
}
public Occupation displayOccupation()
{
return getOccupation();
}
} }
\ No newline at end of file
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/> <SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/>
<SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" /> <SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" />
<SINGLEREFERENCE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" dbcol="template_id" /> <SINGLEREFERENCE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" dbcol="template_id" />
<SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" mandatory="true"/>
</TABLE> </TABLE>
......
...@@ -115,7 +115,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -115,7 +115,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
} }
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.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.postcode, {PREFIX}tl_job.location_radius, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.require_cv, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.last_edited, {PREFIX}tl_job.is_ppj, {PREFIX}tl_job.industry, {PREFIX}tl_job.culture_statement, {PREFIX}tl_job.draft_location, {PREFIX}tl_job.google_address_text, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.job_owner_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.hiring_team_id, {PREFIX}tl_job.occupation_id, {PREFIX}tl_job.shortened_url_id, {PREFIX}tl_job.template_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.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.postcode, {PREFIX}tl_job.location_radius, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.require_cv, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.last_edited, {PREFIX}tl_job.is_ppj, {PREFIX}tl_job.industry, {PREFIX}tl_job.culture_statement, {PREFIX}tl_job.draft_location, {PREFIX}tl_job.google_address_text, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.job_owner_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.hiring_team_id, {PREFIX}tl_job.occupation_id, {PREFIX}tl_job.shortened_url_id, {PREFIX}tl_job.template_id, {PREFIX}tl_job.job_title_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -198,7 +198,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -198,7 +198,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_HiringTeam)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_HiringTeam)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Occupation)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Occupation)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ShortenedURL)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ShortenedURL)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_AssessmentTemplate)) !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_AssessmentTemplate)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ILOJobTitle))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -278,10 +279,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -278,10 +279,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job " + "UPDATE {PREFIX}tl_job " +
"SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, postcode = ?, location_radius = ?, state = ?, country = ?, require_cv = ?, manually_closed = ?, last_edited = ?, is_ppj = ?, industry = ?, culture_statement = ?, draft_location = ?, google_address_text = ?, level_id = ? , client_id = ? , job_owner_id = ? , company_user_id = ? , hiring_team_id = ? , occupation_id = ? , shortened_url_id = ? , template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, postcode = ?, location_radius = ?, state = ?, country = ?, require_cv = ?, manually_closed = ?, last_edited = ?, is_ppj = ?, industry = ?, culture_statement = ?, draft_location = ?, google_address_text = ?, level_id = ? , client_id = ? , job_owner_id = ? , company_user_id = ? , hiring_team_id = ? , occupation_id = ? , shortened_url_id = ? , template_id = ? , job_title_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "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_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).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 (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).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_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).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 (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ILOJobTitle)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -735,6 +736,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -735,6 +736,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ShortenedURL, r.getObject ("shortened_url_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ShortenedURL, r.getObject ("shortened_url_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_AssessmentTemplate, r.getObject ("template_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_AssessmentTemplate, r.getObject ("template_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ILOJobTitle, r.getObject ("job_title_id"));
} }
...@@ -751,10 +753,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -751,10 +753,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job " + "INSERT INTO {PREFIX}tl_job " +
" (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, postcode, location_radius, state, country, require_cv, manually_closed, last_edited, is_ppj, industry, culture_statement, draft_location, google_address_text, level_id, client_id, job_owner_id, company_user_id, hiring_team_id, occupation_id, shortened_url_id, template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, postcode, location_radius, state, country, require_cv, manually_closed, last_edited, is_ppj, industry, culture_statement, draft_location, google_address_text, level_id, client_id, job_owner_id, company_user_id, hiring_team_id, occupation_id, shortened_url_id, template_id, job_title_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_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_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).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 (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))) .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_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).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 (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ILOJobTitle)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED); tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.servlets.jsp.ORMTextSearcher;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.ILikeFilter;
import performa.orm.ILOJobTitle;
public class ILOJobTitleSearcher implements ORMTextSearcher
{
public static ILOJobTitleSearcher INSTANCE = new ILOJobTitleSearcher();
@Override
public BaseBusinessClass[] search(ObjectTransaction ot, String searchTerm)
{
return ILOJobTitle.SearchByAll().andJobTitle(new ILikeFilter(searchTerm, "%", "%")).search(ot);
}
}
...@@ -12,8 +12,30 @@ ...@@ -12,8 +12,30 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in admin portal edit job"); Debug.assertion(job != null && !toRedirect, "Invalid job in admin portal edit job");
ILOJobTitle iloJobTitle = job.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(job.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page"); String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
%> %>
<script type="text/javascript">
$(document).ready(function()
{
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').attr('placeholder','Please select a Job Title');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').addClass("form-control");
$("#occupation span").addClass("form-control");
$("#occupation span").css("padding-top","15px");
});
</script>
<div class="container-fluid"> <div class="container-fluid">
<div class="row content"> <div class="row content">
<div class="main-content-area"> <div class="main-content-area">
...@@ -99,22 +121,32 @@ ...@@ -99,22 +121,32 @@
</div> </div>
<div class="form-page-section"> <div class="form-page-section">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-6">
<label><oneit:label GUIName="Job Type" /></label> <label><oneit:label GUIName="ILO Standard Job Title" /><a href="#" title="This is the set of International Labour Organisation job titles <br/> and is used to model the assessments applicable for this job" class="info-icon"><img src="images/info-icon.png" /></a></label><br/>
<oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/> <tagfile:ormsingleasso_autocomplete obj="<%= job %>" assocName="ILOJobTitle" cssClass="form-control" searcher="<%= ILOJobTitleSearcher.INSTANCE %>" />
</div> </div>
<div class="col-md-6" id="occupation">
<label><oneit:label GUIName="Job Occupation Classification" /></label><br/>
<%-- <input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification"
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/> --%>
<oneit:ormInput obj="<%= job %>" attributeName="OccupationId" type="hidden"/>
<oneit:recalc mode="EscapeHTML" script="job.displayOccupation()" job="<%= job %>"/>
</div> </div>
</div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Industry Classification" /></label> <label><oneit:label GUIName="Job Type" /></label>
<oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/> <oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Job Occupation Classification" /></label> <label><oneit:label GUIName="Industry Classification" /></label>
<input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification" <oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/>
</div>
</div> </div>
</div> </div>
<div class="text-center form-group"> <div class="text-center form-group">
......
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
Debug.assertion(template != null && !toRedirect, "Invalid template in job templates"); Debug.assertion(template != null && !toRedirect, "Invalid template in job templates");
ILOJobTitle iloJobTitle = template.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(process.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
SecUser secUser = SecUser.getTXUser(transaction); SecUser secUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam(); HiringTeam hiringTeam = companyUser.getSelectedTeam();
...@@ -149,6 +158,12 @@ ...@@ -149,6 +158,12 @@
}); });
$('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry'); $('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').attr('placeholder','Please select a Job Title');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').addClass("form-control");
$("#occupation span").addClass("form-control");
$("#occupation span").css("padding-top","15px");
}); });
...@@ -360,23 +375,35 @@ ...@@ -360,23 +375,35 @@
</div> </div>
<div class="form-page-section"> <div class="form-page-section">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-6">
<label><oneit:label GUIName="Job Type" /></label> <label><oneit:label GUIName="ILO Standard Job Title" /><a href="#" title="This is the set of International Labour Organisation job titles <br/> and is used to model the assessments applicable for this job" class="info-icon"><img src="images/info-icon.png" /></a></label><br/>
<oneit:ormEnum obj="<%= template %>" attributeName="JobType" cssClass="form-control"/> <tagfile:ormsingleasso_autocomplete obj="<%= template %>" assocName="ILOJobTitle" cssClass="form-control" searcher="<%= ILOJobTitleSearcher.INSTANCE %>" />
</div> </div>
<div class="col-md-6" id="occupation">
<label><oneit:label GUIName="Job Occupation Classification" /></label><br/>
<%-- <input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification"
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/> --%>
<oneit:ormInput obj="<%= template %>" attributeName="OccupationId" type="hidden"/>
<oneit:recalc mode="EscapeHTML" script="template.displayOccupation()" template="<%= template %>"/>
</div> </div>
</div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Industry Classification" /></label> <label><oneit:label GUIName="Job Type" /></label>
<oneit:ormEnum obj="<%= template %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/> <oneit:ormEnum obj="<%= template %>" attributeName="JobType" cssClass="form-control"/>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Job Occupation Classification" /></label> <label><oneit:label GUIName="Industry Classification" /></label>
<input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification" <oneit:ormEnum obj="<%= template %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
value="<%= template.getOccupation() != null ? template.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= template %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-12">
<div class="styled_checkboxes"> <div class="styled_checkboxes">
......
...@@ -11,6 +11,15 @@ ...@@ -11,6 +11,15 @@
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
ILOJobTitle iloJobTitle = job.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(process.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
SecUser txUser = SecUser.getTXUser(process.getTransaction()); SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
AssessmentCriteriaTemplate[] templates = job.getAssessmentTemplates(); AssessmentCriteriaTemplate[] templates = job.getAssessmentTemplates();
...@@ -144,6 +153,13 @@ ...@@ -144,6 +153,13 @@
}); });
$('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry'); $('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').attr('placeholder','Please select a Job Title');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').addClass("form-control");
$("#occupation span").addClass("form-control");
$("#occupation span").css("padding-top","15px");
}); });
...@@ -368,21 +384,34 @@ ...@@ -368,21 +384,34 @@
</div> </div>
<div class="form-page-section"> <div class="form-page-section">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-6">
<label><oneit:label GUIName="Job Type" /></label> <label><oneit:label GUIName="ILO Standard Job Title" /><a href="#" title="This is the set of International Labour Organisation job titles <br/> and is used to model the assessments applicable for this job" class="info-icon"><img src="images/info-icon.png" /></a></label><br/>
<oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/> <tagfile:ormsingleasso_autocomplete obj="<%= job %>" assocName="ILOJobTitle" cssClass="form-control" searcher="<%= ILOJobTitleSearcher.INSTANCE %>" />
</div>
<div class="col-md-6" id="occupation">
<label><oneit:label GUIName="Job Occupation Classification" /></label><br/>
<%-- <input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification"
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/> --%>
<oneit:ormInput obj="<%= job %>" attributeName="OccupationId" type="hidden"/>
<oneit:recalc mode="EscapeHTML" script="job.displayOccupation()" job="<%= job %>"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Industry Classification" /></label> <label><oneit:label GUIName="Job Type" /></label>
<oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/> <oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Job Occupation Classification" /></label> <label><oneit:label GUIName="Industry Classification" /></label>
<input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification" <oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
......
...@@ -178,6 +178,16 @@ ...@@ -178,6 +178,16 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4 review-medium-title"> <div class="col-md-4 review-medium-title">
<oneit:label GUIName="ILO Job Title" />
</div>
<div class="col-md-8">
<span class="skill-label">
<oneit:toString value="<%= job.getILOJobTitle()%>" mode="EscapeHTML" nullValue="" />
</span>
</div>
</div>
<div class="row">
<div class="col-md-4 review-medium-title">
<oneit:label GUIName="Job Occupation Classification" /> <oneit:label GUIName="Job Occupation Classification" />
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
......
<?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_assessment_template</tableName>
<column name="job_title_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_ilo_job_title</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="job_title" type="String" nullable="true" length="200"/>
<column name="occupation_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<?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="job_title_id" type="Long" length="11" nullable="true"/>
</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