Commit de369962 by nilu

S34576305 # Client - Incoming Issues (raised by Client) #Expose Assessment length

parent 67caa0f9
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
<column name="name" type="String" nullable="false" length="250"/> <column name="name" type="String" nullable="false" length="250"/>
<column name="level" type="String" nullable="false" length="200"/> <column name="level" type="String" nullable="false" length="200"/>
<column name="assessment_type" type="String" nullable="true" length="200"/> <column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="parttime_assessment_type" type="String" nullable="true" length="200"/>
<column name="assessment_level_id" type="Long" length="11" nullable="true"/> <column name="assessment_level_id" type="Long" length="11" nullable="true"/>
<column name="express_assessment_level_id" type="Long" length="11" nullable="true"/>
<column name="parent_occupation_id" type="Long" length="11" nullable="true"/> <column name="parent_occupation_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -12,7 +12,9 @@ CREATE TABLE tl_occupation ( ...@@ -12,7 +12,9 @@ CREATE TABLE tl_occupation (
name varchar(250) NOT NULL, name varchar(250) NOT NULL,
level varchar(200) NOT NULL, level varchar(200) NOT NULL,
assessment_type varchar(200) NULL, assessment_type varchar(200) NULL,
parttime_assessment_type varchar(200) NULL,
assessment_level_id numeric(12) NULL, assessment_level_id numeric(12) NULL,
express_assessment_level_id numeric(12) NULL,
parent_occupation_id numeric(12) NULL parent_occupation_id numeric(12) NULL
); );
......
...@@ -13,7 +13,9 @@ CREATE TABLE tl_occupation ( ...@@ -13,7 +13,9 @@ CREATE TABLE tl_occupation (
name varchar2(250) NOT NULL, name varchar2(250) NOT NULL,
level varchar2(200) NOT NULL, level varchar2(200) NOT NULL,
assessment_type varchar2(200) NULL, assessment_type varchar2(200) NULL,
parttime_assessment_type varchar2(200) NULL,
assessment_level_id number(12) NULL, assessment_level_id number(12) NULL,
express_assessment_level_id number(12) NULL,
parent_occupation_id number(12) NULL parent_occupation_id number(12) NULL
); );
......
...@@ -13,7 +13,9 @@ CREATE TABLE tl_occupation ( ...@@ -13,7 +13,9 @@ CREATE TABLE tl_occupation (
name varchar(250) NOT NULL, name varchar(250) NOT NULL,
level varchar(200) NOT NULL, level varchar(200) NOT NULL,
assessment_type varchar(200) NULL, assessment_type varchar(200) NULL,
parttime_assessment_type varchar(200) NULL,
assessment_level_id numeric(12) NULL, assessment_level_id numeric(12) NULL,
express_assessment_level_id numeric(12) NULL,
parent_occupation_id numeric(12) NULL parent_occupation_id numeric(12) NULL
); );
......
...@@ -81,6 +81,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -81,6 +81,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String FIELD_AssessmentTemplateName = "AssessmentTemplateName"; public static final String FIELD_AssessmentTemplateName = "AssessmentTemplateName";
public static final String FIELD_CultureTemplateName = "CultureTemplateName"; public static final String FIELD_CultureTemplateName = "CultureTemplateName";
public static final String FIELD_AppProcessOption = "AppProcessOption"; public static final String FIELD_AppProcessOption = "AppProcessOption";
public static final String FIELD_SuggestedAssessmentType = "SuggestedAssessmentType";
public static final String FIELD_RankingCompleted = "RankingCompleted"; public static final String FIELD_RankingCompleted = "RankingCompleted";
public static final String SINGLEREFERENCE_CultureTemplate = "CultureTemplate"; public static final String SINGLEREFERENCE_CultureTemplate = "CultureTemplate";
public static final String SINGLEREFERENCE_JobTemplate = "JobTemplate"; public static final String SINGLEREFERENCE_JobTemplate = "JobTemplate";
...@@ -151,6 +152,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -151,6 +152,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final DefaultAttributeHelper<Job> HELPER_AssessmentTemplateName = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Job> HELPER_AssessmentTemplateName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_CultureTemplateName = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Job> HELPER_CultureTemplateName = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Job, AppProcessOption> HELPER_AppProcessOption = new EnumeratedAttributeHelper<Job, AppProcessOption> (AppProcessOption.FACTORY_AppProcessOption); private static final EnumeratedAttributeHelper<Job, AppProcessOption> HELPER_AppProcessOption = new EnumeratedAttributeHelper<Job, AppProcessOption> (AppProcessOption.FACTORY_AppProcessOption);
private static final EnumeratedAttributeHelper<Job, AssessmentType> HELPER_SuggestedAssessmentType = new EnumeratedAttributeHelper<Job, AssessmentType> (AssessmentType.FACTORY_AssessmentType);
private static final DefaultAttributeHelper<Job> HELPER_RankingCompleted = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Job> HELPER_RankingCompleted = DefaultAttributeHelper.INSTANCE;
...@@ -194,6 +196,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -194,6 +196,7 @@ public abstract class BaseJob extends BaseBusinessClass
private String _AssessmentTemplateName; private String _AssessmentTemplateName;
private String _CultureTemplateName; private String _CultureTemplateName;
private AppProcessOption _AppProcessOption; private AppProcessOption _AppProcessOption;
private AssessmentType _SuggestedAssessmentType;
private Boolean _RankingCompleted; private Boolean _RankingCompleted;
...@@ -236,6 +239,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -236,6 +239,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final AttributeValidator[] FIELD_AssessmentTemplateName_Validators; private static final AttributeValidator[] FIELD_AssessmentTemplateName_Validators;
private static final AttributeValidator[] FIELD_CultureTemplateName_Validators; private static final AttributeValidator[] FIELD_CultureTemplateName_Validators;
private static final AttributeValidator[] FIELD_AppProcessOption_Validators; private static final AttributeValidator[] FIELD_AppProcessOption_Validators;
private static final AttributeValidator[] FIELD_SuggestedAssessmentType_Validators;
private static final AttributeValidator[] FIELD_RankingCompleted_Validators; private static final AttributeValidator[] FIELD_RankingCompleted_Validators;
private static final AttributeValidator[] FIELD_JobTitle_Validators; private static final AttributeValidator[] FIELD_JobTitle_Validators;
private static final AttributeValidator[] FIELD_JobDescription_Validators; private static final AttributeValidator[] FIELD_JobDescription_Validators;
...@@ -310,6 +314,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -310,6 +314,7 @@ public abstract class BaseJob extends BaseBusinessClass
FIELD_AssessmentTemplateName_Validators = (AttributeValidator[])setupAttribMetaData_AssessmentTemplateName(validatorMapping).toArray (new AttributeValidator[0]); FIELD_AssessmentTemplateName_Validators = (AttributeValidator[])setupAttribMetaData_AssessmentTemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_CultureTemplateName_Validators = (AttributeValidator[])setupAttribMetaData_CultureTemplateName(validatorMapping).toArray (new AttributeValidator[0]); FIELD_CultureTemplateName_Validators = (AttributeValidator[])setupAttribMetaData_CultureTemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AppProcessOption_Validators = (AttributeValidator[])setupAttribMetaData_AppProcessOption(validatorMapping).toArray (new AttributeValidator[0]); FIELD_AppProcessOption_Validators = (AttributeValidator[])setupAttribMetaData_AppProcessOption(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_SuggestedAssessmentType_Validators = (AttributeValidator[])setupAttribMetaData_SuggestedAssessmentType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RankingCompleted_Validators = (AttributeValidator[])setupAttribMetaData_RankingCompleted(validatorMapping).toArray (new AttributeValidator[0]); FIELD_RankingCompleted_Validators = (AttributeValidator[])setupAttribMetaData_RankingCompleted(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]);
FIELD_JobDescription_Validators = (AttributeValidator[])setupAttribMetaData_JobDescription(validatorMapping).toArray (new AttributeValidator[0]); FIELD_JobDescription_Validators = (AttributeValidator[])setupAttribMetaData_JobDescription(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -807,6 +812,24 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -807,6 +812,24 @@ public abstract class BaseJob extends BaseBusinessClass
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_SuggestedAssessmentType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("name", "SuggestedAssessmentType");
metaInfo.put ("type", "AssessmentType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.SuggestedAssessmentType:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_SuggestedAssessmentType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Job.class, "SuggestedAssessmentType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.SuggestedAssessmentType:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_RankingCompleted(Map validatorMapping) private static List setupAttribMetaData_RankingCompleted(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -1393,6 +1416,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1393,6 +1416,7 @@ public abstract class BaseJob extends BaseBusinessClass
_AssessmentTemplateName = (String)(HELPER_AssessmentTemplateName.initialise (_AssessmentTemplateName)); _AssessmentTemplateName = (String)(HELPER_AssessmentTemplateName.initialise (_AssessmentTemplateName));
_CultureTemplateName = (String)(HELPER_CultureTemplateName.initialise (_CultureTemplateName)); _CultureTemplateName = (String)(HELPER_CultureTemplateName.initialise (_CultureTemplateName));
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.initialise (_AppProcessOption)); _AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.initialise (_AppProcessOption));
_SuggestedAssessmentType = (AssessmentType)(HELPER_SuggestedAssessmentType.initialise (_SuggestedAssessmentType));
_RankingCompleted = (Boolean)(HELPER_RankingCompleted.initialise (_RankingCompleted)); _RankingCompleted = (Boolean)(HELPER_RankingCompleted.initialise (_RankingCompleted));
} }
...@@ -5283,6 +5307,104 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5283,6 +5307,104 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the attribute SuggestedAssessmentType
*/
public AssessmentType getSuggestedAssessmentType ()
{
assertValid();
AssessmentType valToReturn = _SuggestedAssessmentType;
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
valToReturn = bhd.getSuggestedAssessmentType ((Job)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 preSuggestedAssessmentTypeChange (AssessmentType newSuggestedAssessmentType) 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 postSuggestedAssessmentTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_SuggestedAssessmentType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute SuggestedAssessmentType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSuggestedAssessmentType (AssessmentType newSuggestedAssessmentType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_SuggestedAssessmentType.compare (_SuggestedAssessmentType, newSuggestedAssessmentType);
try
{
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
newSuggestedAssessmentType = bhd.setSuggestedAssessmentType ((Job)this, newSuggestedAssessmentType);
oldAndNewIdentical = HELPER_SuggestedAssessmentType.compare (_SuggestedAssessmentType, newSuggestedAssessmentType);
}
if (FIELD_SuggestedAssessmentType_Validators.length > 0)
{
Object newSuggestedAssessmentTypeObj = HELPER_SuggestedAssessmentType.toObject (newSuggestedAssessmentType);
if (newSuggestedAssessmentTypeObj != null)
{
int loopMax = FIELD_SuggestedAssessmentType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_SuggestedAssessmentType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_SuggestedAssessmentType_Validators[v].checkAttribute (this, FIELD_SuggestedAssessmentType, metadata, newSuggestedAssessmentTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_SuggestedAssessmentType () != FieldWriteability.FALSE, "Field SuggestedAssessmentType is not writeable");
preSuggestedAssessmentTypeChange (newSuggestedAssessmentType);
markFieldChange (FIELD_SuggestedAssessmentType);
_SuggestedAssessmentType = newSuggestedAssessmentType;
postFieldChange (FIELD_SuggestedAssessmentType);
postSuggestedAssessmentTypeChange ();
}
}
/**
* Get the attribute RankingCompleted * Get the attribute RankingCompleted
*/ */
public Boolean getRankingCompleted () public Boolean getRankingCompleted ()
...@@ -7901,6 +8023,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7901,6 +8023,7 @@ public abstract class BaseJob extends BaseBusinessClass
_AssessmentTemplateName = sourceJob._AssessmentTemplateName; _AssessmentTemplateName = sourceJob._AssessmentTemplateName;
_CultureTemplateName = sourceJob._CultureTemplateName; _CultureTemplateName = sourceJob._CultureTemplateName;
_AppProcessOption = sourceJob._AppProcessOption; _AppProcessOption = sourceJob._AppProcessOption;
_SuggestedAssessmentType = sourceJob._SuggestedAssessmentType;
_RankingCompleted = sourceJob._RankingCompleted; _RankingCompleted = sourceJob._RankingCompleted;
} }
...@@ -8013,6 +8136,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8013,6 +8136,7 @@ public abstract class BaseJob extends BaseBusinessClass
_AssessmentTemplateName = (String)(HELPER_AssessmentTemplateName.readExternal (_AssessmentTemplateName, vals.get(FIELD_AssessmentTemplateName))); // _AssessmentTemplateName = (String)(HELPER_AssessmentTemplateName.readExternal (_AssessmentTemplateName, vals.get(FIELD_AssessmentTemplateName))); //
_CultureTemplateName = (String)(HELPER_CultureTemplateName.readExternal (_CultureTemplateName, vals.get(FIELD_CultureTemplateName))); // _CultureTemplateName = (String)(HELPER_CultureTemplateName.readExternal (_CultureTemplateName, vals.get(FIELD_CultureTemplateName))); //
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.readExternal (_AppProcessOption, vals.get(FIELD_AppProcessOption))); // _AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.readExternal (_AppProcessOption, vals.get(FIELD_AppProcessOption))); //
_SuggestedAssessmentType = (AssessmentType)(HELPER_SuggestedAssessmentType.readExternal (_SuggestedAssessmentType, vals.get(FIELD_SuggestedAssessmentType))); //
_RankingCompleted = (Boolean)(HELPER_RankingCompleted.readExternal (_RankingCompleted, vals.get(FIELD_RankingCompleted))); // _RankingCompleted = (Boolean)(HELPER_RankingCompleted.readExternal (_RankingCompleted, vals.get(FIELD_RankingCompleted))); //
_CultureTemplate.readExternalData(vals.get(SINGLEREFERENCE_CultureTemplate)); _CultureTemplate.readExternalData(vals.get(SINGLEREFERENCE_CultureTemplate));
_JobTemplate.readExternalData(vals.get(SINGLEREFERENCE_JobTemplate)); _JobTemplate.readExternalData(vals.get(SINGLEREFERENCE_JobTemplate));
...@@ -8080,6 +8204,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8080,6 +8204,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (FIELD_AssessmentTemplateName, HELPER_AssessmentTemplateName.writeExternal (_AssessmentTemplateName)); vals.put (FIELD_AssessmentTemplateName, HELPER_AssessmentTemplateName.writeExternal (_AssessmentTemplateName));
vals.put (FIELD_CultureTemplateName, HELPER_CultureTemplateName.writeExternal (_CultureTemplateName)); vals.put (FIELD_CultureTemplateName, HELPER_CultureTemplateName.writeExternal (_CultureTemplateName));
vals.put (FIELD_AppProcessOption, HELPER_AppProcessOption.writeExternal (_AppProcessOption)); vals.put (FIELD_AppProcessOption, HELPER_AppProcessOption.writeExternal (_AppProcessOption));
vals.put (FIELD_SuggestedAssessmentType, HELPER_SuggestedAssessmentType.writeExternal (_SuggestedAssessmentType));
vals.put (FIELD_RankingCompleted, HELPER_RankingCompleted.writeExternal (_RankingCompleted)); vals.put (FIELD_RankingCompleted, HELPER_RankingCompleted.writeExternal (_RankingCompleted));
vals.put (SINGLEREFERENCE_CultureTemplate, _CultureTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_CultureTemplate, _CultureTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_JobTemplate, _JobTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_JobTemplate, _JobTemplate.writeExternalData());
...@@ -8257,6 +8382,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8257,6 +8382,7 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitField(this, FIELD_AssessmentTemplateName, HELPER_AssessmentTemplateName.toObject(getAssessmentTemplateName())); visitor.visitField(this, FIELD_AssessmentTemplateName, HELPER_AssessmentTemplateName.toObject(getAssessmentTemplateName()));
visitor.visitField(this, FIELD_CultureTemplateName, HELPER_CultureTemplateName.toObject(getCultureTemplateName())); visitor.visitField(this, FIELD_CultureTemplateName, HELPER_CultureTemplateName.toObject(getCultureTemplateName()));
visitor.visitField(this, FIELD_AppProcessOption, HELPER_AppProcessOption.toObject(getAppProcessOption())); visitor.visitField(this, FIELD_AppProcessOption, HELPER_AppProcessOption.toObject(getAppProcessOption()));
visitor.visitField(this, FIELD_SuggestedAssessmentType, HELPER_SuggestedAssessmentType.toObject(getSuggestedAssessmentType()));
visitor.visitField(this, FIELD_RankingCompleted, HELPER_RankingCompleted.toObject(getRankingCompleted())); visitor.visitField(this, FIELD_RankingCompleted, HELPER_RankingCompleted.toObject(getRankingCompleted()));
} }
...@@ -9786,6 +9912,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9786,6 +9912,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return HELPER_AppProcessOption.toObject (getAppProcessOption ()); return HELPER_AppProcessOption.toObject (getAppProcessOption ());
} }
else if (attribName.equals (FIELD_SuggestedAssessmentType))
{
return HELPER_SuggestedAssessmentType.toObject (getSuggestedAssessmentType ());
}
else if (attribName.equals (FIELD_RankingCompleted)) else if (attribName.equals (FIELD_RankingCompleted))
{ {
return HELPER_RankingCompleted.toObject (getRankingCompleted ()); return HELPER_RankingCompleted.toObject (getRankingCompleted ());
...@@ -9959,6 +10089,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9959,6 +10089,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return HELPER_AppProcessOption; return HELPER_AppProcessOption;
} }
else if (attribName.equals (FIELD_SuggestedAssessmentType))
{
return HELPER_SuggestedAssessmentType;
}
else if (attribName.equals (FIELD_RankingCompleted)) else if (attribName.equals (FIELD_RankingCompleted))
{ {
return HELPER_RankingCompleted; return HELPER_RankingCompleted;
...@@ -10132,6 +10266,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10132,6 +10266,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
setAppProcessOption ((AppProcessOption)(HELPER_AppProcessOption.fromObject (_AppProcessOption, attribValue))); setAppProcessOption ((AppProcessOption)(HELPER_AppProcessOption.fromObject (_AppProcessOption, attribValue)));
} }
else if (attribName.equals (FIELD_SuggestedAssessmentType))
{
setSuggestedAssessmentType ((AssessmentType)(HELPER_SuggestedAssessmentType.fromObject (_SuggestedAssessmentType, attribValue)));
}
else if (attribName.equals (FIELD_RankingCompleted)) else if (attribName.equals (FIELD_RankingCompleted))
{ {
setRankingCompleted ((Boolean)(HELPER_RankingCompleted.fromObject (_RankingCompleted, attribValue))); setRankingCompleted ((Boolean)(HELPER_RankingCompleted.fromObject (_RankingCompleted, attribValue)));
...@@ -10364,6 +10502,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10364,6 +10502,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return getWriteability_AppProcessOption (); return getWriteability_AppProcessOption ();
} }
else if (fieldName.equals (FIELD_SuggestedAssessmentType))
{
return getWriteability_SuggestedAssessmentType ();
}
else if (fieldName.equals (FIELD_RankingCompleted)) else if (fieldName.equals (FIELD_RankingCompleted))
{ {
return getWriteability_RankingCompleted (); return getWriteability_RankingCompleted ();
...@@ -10585,6 +10727,11 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10585,6 +10727,11 @@ public abstract class BaseJob extends BaseBusinessClass
fields.add (FIELD_AppProcessOption); fields.add (FIELD_AppProcessOption);
} }
if (getWriteability_SuggestedAssessmentType () != FieldWriteability.TRUE)
{
fields.add (FIELD_SuggestedAssessmentType);
}
if (getWriteability_RankingCompleted () != FieldWriteability.TRUE) if (getWriteability_RankingCompleted () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_RankingCompleted); fields.add (FIELD_RankingCompleted);
...@@ -10638,6 +10785,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10638,6 +10785,7 @@ public abstract class BaseJob extends BaseBusinessClass
result.add(HELPER_AssessmentTemplateName.getAttribObject (getClass (), _AssessmentTemplateName, false, FIELD_AssessmentTemplateName)); result.add(HELPER_AssessmentTemplateName.getAttribObject (getClass (), _AssessmentTemplateName, false, FIELD_AssessmentTemplateName));
result.add(HELPER_CultureTemplateName.getAttribObject (getClass (), _CultureTemplateName, false, FIELD_CultureTemplateName)); result.add(HELPER_CultureTemplateName.getAttribObject (getClass (), _CultureTemplateName, false, FIELD_CultureTemplateName));
result.add(HELPER_AppProcessOption.getAttribObject (getClass (), _AppProcessOption, false, FIELD_AppProcessOption)); result.add(HELPER_AppProcessOption.getAttribObject (getClass (), _AppProcessOption, false, FIELD_AppProcessOption));
result.add(HELPER_SuggestedAssessmentType.getAttribObject (getClass (), _SuggestedAssessmentType, false, FIELD_SuggestedAssessmentType));
result.add(HELPER_RankingCompleted.getAttribObject (getClass (), _RankingCompleted, false, FIELD_RankingCompleted)); result.add(HELPER_RankingCompleted.getAttribObject (getClass (), _RankingCompleted, false, FIELD_RankingCompleted));
return result; return result;
...@@ -11392,6 +11540,24 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11392,6 +11540,24 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the attribute SuggestedAssessmentType
*/
public AssessmentType getSuggestedAssessmentType (Job obj, AssessmentType original)
{
return original;
}
/**
* Change the value set for attribute SuggestedAssessmentType.
* May modify the field beforehand
* Occurs before validation.
*/
public AssessmentType setSuggestedAssessmentType (Job obj, AssessmentType newSuggestedAssessmentType) throws FieldException
{
return newSuggestedAssessmentType;
}
/**
* Get the attribute RankingCompleted * Get the attribute RankingCompleted
*/ */
public Boolean getRankingCompleted (Job obj, Boolean original) public Boolean getRankingCompleted (Job obj, Boolean original)
...@@ -11529,6 +11695,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11529,6 +11695,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return toAppProcessOption (); return toAppProcessOption ();
} }
if (name.equals ("SuggestedAssessmentType"))
{
return toSuggestedAssessmentType ();
}
if (name.equals ("RankingCompleted")) if (name.equals ("RankingCompleted"))
{ {
return toRankingCompleted (); return toRankingCompleted ();
...@@ -11717,6 +11887,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11717,6 +11887,8 @@ public abstract class BaseJob extends BaseBusinessClass
public PipeLine<From, AppProcessOption> toAppProcessOption () { return pipe(new ORMAttributePipe<Me, AppProcessOption>(FIELD_AppProcessOption)); } public PipeLine<From, AppProcessOption> toAppProcessOption () { return pipe(new ORMAttributePipe<Me, AppProcessOption>(FIELD_AppProcessOption)); }
public PipeLine<From, AssessmentType> toSuggestedAssessmentType () { return pipe(new ORMAttributePipe<Me, AssessmentType>(FIELD_SuggestedAssessmentType)); }
public PipeLine<From, Boolean> toRankingCompleted () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_RankingCompleted)); } public PipeLine<From, Boolean> toRankingCompleted () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_RankingCompleted)); }
public PipeLine<From, String> toJobTitle () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobTitle)); } public PipeLine<From, String> toJobTitle () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobTitle)); }
...@@ -11937,6 +12109,11 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11937,6 +12109,11 @@ public abstract class BaseJob extends BaseBusinessClass
return true; return true;
} }
if(CollectionUtils.equals(attribName, "SuggestedAssessmentType"))
{
return true;
}
if(CollectionUtils.equals(attribName, "RankingCompleted")) if(CollectionUtils.equals(attribName, "RankingCompleted"))
{ {
return true; return true;
......
...@@ -44,7 +44,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -44,7 +44,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
public static final String FIELD_Name = "Name"; public static final String FIELD_Name = "Name";
public static final String FIELD_Level = "Level"; public static final String FIELD_Level = "Level";
public static final String FIELD_AssessmentType = "AssessmentType"; public static final String FIELD_AssessmentType = "AssessmentType";
public static final String FIELD_PartTimeAssessmentType = "PartTimeAssessmentType";
public static final String SINGLEREFERENCE_AssessmentLevel = "AssessmentLevel"; public static final String SINGLEREFERENCE_AssessmentLevel = "AssessmentLevel";
public static final String SINGLEREFERENCE_ExpressAssessmentLevel = "ExpressAssessmentLevel";
public static final String SINGLEREFERENCE_ParentOccupation = "ParentOccupation"; public static final String SINGLEREFERENCE_ParentOccupation = "ParentOccupation";
public static final String BACKREF_ParentOccupation = ""; public static final String BACKREF_ParentOccupation = "";
public static final String MULTIPLEREFERENCE_ChildOccupations = "ChildOccupations"; public static final String MULTIPLEREFERENCE_ChildOccupations = "ChildOccupations";
...@@ -59,6 +61,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -59,6 +61,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
private static final DefaultAttributeHelper<Occupation> HELPER_Name = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Occupation> HELPER_Name = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Occupation, OccupationLevel> HELPER_Level = new EnumeratedAttributeHelper<Occupation, OccupationLevel> (OccupationLevel.FACTORY_OccupationLevel); private static final EnumeratedAttributeHelper<Occupation, OccupationLevel> HELPER_Level = new EnumeratedAttributeHelper<Occupation, OccupationLevel> (OccupationLevel.FACTORY_OccupationLevel);
private static final EnumeratedAttributeHelper<Occupation, AssessmentType> HELPER_AssessmentType = new EnumeratedAttributeHelper<Occupation, AssessmentType> (AssessmentType.FACTORY_AssessmentType); private static final EnumeratedAttributeHelper<Occupation, AssessmentType> HELPER_AssessmentType = new EnumeratedAttributeHelper<Occupation, AssessmentType> (AssessmentType.FACTORY_AssessmentType);
private static final EnumeratedAttributeHelper<Occupation, AssessmentType> HELPER_PartTimeAssessmentType = new EnumeratedAttributeHelper<Occupation, AssessmentType> (AssessmentType.FACTORY_AssessmentType);
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -66,10 +69,12 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -66,10 +69,12 @@ public abstract class BaseOccupation extends BaseBusinessClass
private String _Name; private String _Name;
private OccupationLevel _Level; private OccupationLevel _Level;
private AssessmentType _AssessmentType; private AssessmentType _AssessmentType;
private AssessmentType _PartTimeAssessmentType;
// Private attributes corresponding to single references // Private attributes corresponding to single references
private SingleAssociation<Occupation, Level> _AssessmentLevel; private SingleAssociation<Occupation, Level> _AssessmentLevel;
private SingleAssociation<Occupation, Level> _ExpressAssessmentLevel;
private SingleAssociation<Occupation, Occupation> _ParentOccupation; private SingleAssociation<Occupation, Occupation> _ParentOccupation;
...@@ -85,6 +90,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -85,6 +90,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
private static final AttributeValidator[] FIELD_Name_Validators; private static final AttributeValidator[] FIELD_Name_Validators;
private static final AttributeValidator[] FIELD_Level_Validators; private static final AttributeValidator[] FIELD_Level_Validators;
private static final AttributeValidator[] FIELD_AssessmentType_Validators; private static final AttributeValidator[] FIELD_AssessmentType_Validators;
private static final AttributeValidator[] FIELD_PartTimeAssessmentType_Validators;
// Arrays of behaviour decorators // Arrays of behaviour decorators
...@@ -102,11 +108,13 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -102,11 +108,13 @@ public abstract class BaseOccupation extends BaseBusinessClass
setupAssocMetaData_ChildOccupations(); setupAssocMetaData_ChildOccupations();
setupAssocMetaData_AssessmentLevel(); setupAssocMetaData_AssessmentLevel();
setupAssocMetaData_ExpressAssessmentLevel();
setupAssocMetaData_ParentOccupation(); setupAssocMetaData_ParentOccupation();
FIELD_Code_Validators = (AttributeValidator[])setupAttribMetaData_Code(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Code_Validators = (AttributeValidator[])setupAttribMetaData_Code(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Name_Validators = (AttributeValidator[])setupAttribMetaData_Name(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Name_Validators = (AttributeValidator[])setupAttribMetaData_Name(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Level_Validators = (AttributeValidator[])setupAttribMetaData_Level(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Level_Validators = (AttributeValidator[])setupAttribMetaData_Level(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AssessmentType_Validators = (AttributeValidator[])setupAttribMetaData_AssessmentType(validatorMapping).toArray (new AttributeValidator[0]); FIELD_AssessmentType_Validators = (AttributeValidator[])setupAttribMetaData_AssessmentType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PartTimeAssessmentType_Validators = (AttributeValidator[])setupAttribMetaData_PartTimeAssessmentType(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Occupation.initialiseReference (); REFERENCE_Occupation.initialiseReference ();
...@@ -150,6 +158,20 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -150,6 +158,20 @@ public abstract class BaseOccupation extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ExpressAssessmentLevel()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "express_assessment_level_id");
metaInfo.put ("name", "ExpressAssessmentLevel");
metaInfo.put ("type", "Level");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Occupation.ExpressAssessmentLevel:", metaInfo);
ATTRIBUTES_METADATA_Occupation.put (SINGLEREFERENCE_ExpressAssessmentLevel, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_ParentOccupation() private static void setupAssocMetaData_ParentOccupation()
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -244,6 +266,25 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -244,6 +266,25 @@ public abstract class BaseOccupation extends BaseBusinessClass
return validators; return validators;
} }
// Meta Info setup
private static List setupAttribMetaData_PartTimeAssessmentType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "parttime_assessment_type");
metaInfo.put ("name", "PartTimeAssessmentType");
metaInfo.put ("type", "AssessmentType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Occupation.PartTimeAssessmentType:", metaInfo);
ATTRIBUTES_METADATA_Occupation.put (FIELD_PartTimeAssessmentType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Occupation.class, "PartTimeAssessmentType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Occupation.PartTimeAssessmentType:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION // END OF STATIC METADATA DEFINITION
...@@ -275,6 +316,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -275,6 +316,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
_Name = (String)(HELPER_Name.initialise (_Name)); _Name = (String)(HELPER_Name.initialise (_Name));
_Level = (OccupationLevel)(HELPER_Level.initialise (_Level)); _Level = (OccupationLevel)(HELPER_Level.initialise (_Level));
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (_AssessmentType)); _AssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (_AssessmentType));
_PartTimeAssessmentType = (AssessmentType)(HELPER_PartTimeAssessmentType.initialise (_PartTimeAssessmentType));
} }
...@@ -284,6 +326,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -284,6 +326,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
super._initialiseAssociations (); super._initialiseAssociations ();
_AssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_AssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation"); _AssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_AssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation");
_ExpressAssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_ExpressAssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation");
_ParentOccupation = new SingleAssociation<Occupation, Occupation> (this, SINGLEREFERENCE_ParentOccupation, Occupation.MULTIPLEREFERENCE_ChildOccupations, Occupation.REFERENCE_Occupation, "tl_occupation"); _ParentOccupation = new SingleAssociation<Occupation, Occupation> (this, SINGLEREFERENCE_ParentOccupation, Occupation.MULTIPLEREFERENCE_ChildOccupations, Occupation.REFERENCE_Occupation, "tl_occupation");
_ChildOccupations = new MultipleAssociation<Occupation, Occupation> (this, MULTIPLEREFERENCE_ChildOccupations, Occupation.SINGLEREFERENCE_ParentOccupation, Occupation.REFERENCE_Occupation); _ChildOccupations = new MultipleAssociation<Occupation, Occupation> (this, MULTIPLEREFERENCE_ChildOccupations, Occupation.SINGLEREFERENCE_ParentOccupation, Occupation.REFERENCE_Occupation);
...@@ -296,6 +339,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -296,6 +339,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
super.initialiseReference (); super.initialiseReference ();
_AssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_AssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation"); _AssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_AssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation");
_ExpressAssessmentLevel = new SingleAssociation<Occupation, Level> (this, SINGLEREFERENCE_ExpressAssessmentLevel, null, Level.REFERENCE_Level, "tl_occupation");
_ParentOccupation = new SingleAssociation<Occupation, Occupation> (this, SINGLEREFERENCE_ParentOccupation, Occupation.MULTIPLEREFERENCE_ChildOccupations, Occupation.REFERENCE_Occupation, "tl_occupation"); _ParentOccupation = new SingleAssociation<Occupation, Occupation> (this, SINGLEREFERENCE_ParentOccupation, Occupation.MULTIPLEREFERENCE_ChildOccupations, Occupation.REFERENCE_Occupation, "tl_occupation");
_ChildOccupations = new MultipleAssociation<Occupation, Occupation> (this, MULTIPLEREFERENCE_ChildOccupations, Occupation.SINGLEREFERENCE_ParentOccupation, Occupation.REFERENCE_Occupation); _ChildOccupations = new MultipleAssociation<Occupation, Occupation> (this, MULTIPLEREFERENCE_ChildOccupations, Occupation.SINGLEREFERENCE_ParentOccupation, Occupation.REFERENCE_Occupation);
...@@ -700,6 +744,104 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -700,6 +744,104 @@ public abstract class BaseOccupation extends BaseBusinessClass
} }
} }
/**
* Get the attribute PartTimeAssessmentType
*/
public AssessmentType getPartTimeAssessmentType ()
{
assertValid();
AssessmentType valToReturn = _PartTimeAssessmentType;
for (OccupationBehaviourDecorator bhd : Occupation_BehaviourDecorators)
{
valToReturn = bhd.getPartTimeAssessmentType ((Occupation)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 prePartTimeAssessmentTypeChange (AssessmentType newPartTimeAssessmentType) 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 postPartTimeAssessmentTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_PartTimeAssessmentType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PartTimeAssessmentType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPartTimeAssessmentType (AssessmentType newPartTimeAssessmentType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PartTimeAssessmentType.compare (_PartTimeAssessmentType, newPartTimeAssessmentType);
try
{
for (OccupationBehaviourDecorator bhd : Occupation_BehaviourDecorators)
{
newPartTimeAssessmentType = bhd.setPartTimeAssessmentType ((Occupation)this, newPartTimeAssessmentType);
oldAndNewIdentical = HELPER_PartTimeAssessmentType.compare (_PartTimeAssessmentType, newPartTimeAssessmentType);
}
if (FIELD_PartTimeAssessmentType_Validators.length > 0)
{
Object newPartTimeAssessmentTypeObj = HELPER_PartTimeAssessmentType.toObject (newPartTimeAssessmentType);
if (newPartTimeAssessmentTypeObj != null)
{
int loopMax = FIELD_PartTimeAssessmentType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Occupation.get (FIELD_PartTimeAssessmentType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PartTimeAssessmentType_Validators[v].checkAttribute (this, FIELD_PartTimeAssessmentType, metadata, newPartTimeAssessmentTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PartTimeAssessmentType () != FieldWriteability.FALSE, "Field PartTimeAssessmentType is not writeable");
prePartTimeAssessmentTypeChange (newPartTimeAssessmentType);
markFieldChange (FIELD_PartTimeAssessmentType);
_PartTimeAssessmentType = newPartTimeAssessmentType;
postFieldChange (FIELD_PartTimeAssessmentType);
postPartTimeAssessmentTypeChange ();
}
}
/** /**
...@@ -712,6 +854,8 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -712,6 +854,8 @@ public abstract class BaseOccupation extends BaseBusinessClass
result.add("AssessmentLevel"); result.add("AssessmentLevel");
result.add("ExpressAssessmentLevel");
result.add("ParentOccupation"); result.add("ParentOccupation");
...@@ -728,6 +872,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -728,6 +872,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return _AssessmentLevel.getReferencedType (); return _AssessmentLevel.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return _ExpressAssessmentLevel.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return _ParentOccupation.getReferencedType (); return _ParentOccupation.getReferencedType ();
...@@ -748,6 +895,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -748,6 +895,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return null ;
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return Occupation.MULTIPLEREFERENCE_ChildOccupations ; return Occupation.MULTIPLEREFERENCE_ChildOccupations ;
...@@ -768,6 +918,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -768,6 +918,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return getAssessmentLevel (); return getAssessmentLevel ();
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return getExpressAssessmentLevel ();
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return getParentOccupation (); return getParentOccupation ();
...@@ -788,6 +941,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -788,6 +941,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return getAssessmentLevel (getType); return getAssessmentLevel (getType);
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return getExpressAssessmentLevel (getType);
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return getParentOccupation (getType); return getParentOccupation (getType);
...@@ -808,6 +964,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -808,6 +964,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return getAssessmentLevelID (); return getAssessmentLevelID ();
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return getExpressAssessmentLevelID ();
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return getParentOccupationID (); return getParentOccupationID ();
...@@ -828,6 +987,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -828,6 +987,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (assocName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
setAssessmentLevel ((Level)(newValue)); setAssessmentLevel ((Level)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
setExpressAssessmentLevel ((Level)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ParentOccupation)) }else if (assocName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
setParentOccupation ((Occupation)(newValue)); setParentOccupation ((Occupation)(newValue));
...@@ -935,6 +1097,100 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -935,6 +1097,100 @@ public abstract class BaseOccupation extends BaseBusinessClass
} }
/** /**
* Get the reference ExpressAssessmentLevel
*/
public Level getExpressAssessmentLevel () throws StorageException
{
assertValid();
try
{
return (Level)(_ExpressAssessmentLevel.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Occupation:", this.getObjectID (), ", was trying to get Level:", getExpressAssessmentLevelID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ExpressAssessmentLevel.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Level getExpressAssessmentLevel (Get getType) throws StorageException
{
assertValid();
return _ExpressAssessmentLevel.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getExpressAssessmentLevelID ()
{
assertValid();
if (_ExpressAssessmentLevel == null)
{
return null;
}
else
{
return _ExpressAssessmentLevel.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 preExpressAssessmentLevelChange (Level newExpressAssessmentLevel) 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 postExpressAssessmentLevelChange () throws FieldException
{
}
public FieldWriteability getWriteability_ExpressAssessmentLevel ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ExpressAssessmentLevel. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setExpressAssessmentLevel (Level newExpressAssessmentLevel) throws StorageException, FieldException
{
if (_ExpressAssessmentLevel.wouldReferencedChange (newExpressAssessmentLevel))
{
assertValid();
Debug.assertion (getWriteability_ExpressAssessmentLevel () != FieldWriteability.FALSE, "Assoc ExpressAssessmentLevel is not writeable");
preExpressAssessmentLevelChange (newExpressAssessmentLevel);
_ExpressAssessmentLevel.set (newExpressAssessmentLevel);
postExpressAssessmentLevelChange ();
}
}
/**
* Get the reference ParentOccupation * Get the reference ParentOccupation
*/ */
public Occupation getParentOccupation () throws StorageException public Occupation getParentOccupation () throws StorageException
...@@ -1339,7 +1595,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1339,7 +1595,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
tl_occupationPSet.setAttrib (FIELD_Name, HELPER_Name.toObject (_Name)); // tl_occupationPSet.setAttrib (FIELD_Name, HELPER_Name.toObject (_Name)); //
tl_occupationPSet.setAttrib (FIELD_Level, HELPER_Level.toObject (_Level)); // tl_occupationPSet.setAttrib (FIELD_Level, HELPER_Level.toObject (_Level)); //
tl_occupationPSet.setAttrib (FIELD_AssessmentType, HELPER_AssessmentType.toObject (_AssessmentType)); // tl_occupationPSet.setAttrib (FIELD_AssessmentType, HELPER_AssessmentType.toObject (_AssessmentType)); //
tl_occupationPSet.setAttrib (FIELD_PartTimeAssessmentType, HELPER_PartTimeAssessmentType.toObject (_PartTimeAssessmentType)); //
_AssessmentLevel.getPersistentSets (allSets); _AssessmentLevel.getPersistentSets (allSets);
_ExpressAssessmentLevel.getPersistentSets (allSets);
_ParentOccupation.getPersistentSets (allSets); _ParentOccupation.getPersistentSets (allSets);
} }
...@@ -1359,7 +1617,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1359,7 +1617,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
_Name = (String)(HELPER_Name.fromObject (_Name, tl_occupationPSet.getAttrib (FIELD_Name))); // _Name = (String)(HELPER_Name.fromObject (_Name, tl_occupationPSet.getAttrib (FIELD_Name))); //
_Level = (OccupationLevel)(HELPER_Level.fromObject (_Level, tl_occupationPSet.getAttrib (FIELD_Level))); // _Level = (OccupationLevel)(HELPER_Level.fromObject (_Level, tl_occupationPSet.getAttrib (FIELD_Level))); //
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, tl_occupationPSet.getAttrib (FIELD_AssessmentType))); // _AssessmentType = (AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, tl_occupationPSet.getAttrib (FIELD_AssessmentType))); //
_PartTimeAssessmentType = (AssessmentType)(HELPER_PartTimeAssessmentType.fromObject (_PartTimeAssessmentType, tl_occupationPSet.getAttrib (FIELD_PartTimeAssessmentType))); //
_AssessmentLevel.setFromPersistentSets (objectID, allSets); _AssessmentLevel.setFromPersistentSets (objectID, allSets);
_ExpressAssessmentLevel.setFromPersistentSets (objectID, allSets);
_ParentOccupation.setFromPersistentSets (objectID, allSets); _ParentOccupation.setFromPersistentSets (objectID, allSets);
} }
...@@ -1412,6 +1672,15 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1412,6 +1672,15 @@ public abstract class BaseOccupation extends BaseBusinessClass
e.addException (ex); e.addException (ex);
} }
try
{
setPartTimeAssessmentType (otherOccupation.getPartTimeAssessmentType ());
}
catch (FieldException ex)
{
e.addException (ex);
}
} }
} }
...@@ -1431,6 +1700,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1431,6 +1700,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
_Name = sourceOccupation._Name; _Name = sourceOccupation._Name;
_Level = sourceOccupation._Level; _Level = sourceOccupation._Level;
_AssessmentType = sourceOccupation._AssessmentType; _AssessmentType = sourceOccupation._AssessmentType;
_PartTimeAssessmentType = sourceOccupation._PartTimeAssessmentType;
} }
} }
...@@ -1448,6 +1718,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1448,6 +1718,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
BaseOccupation sourceOccupation = (BaseOccupation)(source); BaseOccupation sourceOccupation = (BaseOccupation)(source);
_AssessmentLevel.copyFrom (sourceOccupation._AssessmentLevel, linkToGhosts); _AssessmentLevel.copyFrom (sourceOccupation._AssessmentLevel, linkToGhosts);
_ExpressAssessmentLevel.copyFrom (sourceOccupation._ExpressAssessmentLevel, linkToGhosts);
_ParentOccupation.copyFrom (sourceOccupation._ParentOccupation, linkToGhosts); _ParentOccupation.copyFrom (sourceOccupation._ParentOccupation, linkToGhosts);
} }
...@@ -1490,7 +1761,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1490,7 +1761,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
_Name = (String)(HELPER_Name.readExternal (_Name, vals.get(FIELD_Name))); // _Name = (String)(HELPER_Name.readExternal (_Name, vals.get(FIELD_Name))); //
_Level = (OccupationLevel)(HELPER_Level.readExternal (_Level, vals.get(FIELD_Level))); // _Level = (OccupationLevel)(HELPER_Level.readExternal (_Level, vals.get(FIELD_Level))); //
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.readExternal (_AssessmentType, vals.get(FIELD_AssessmentType))); // _AssessmentType = (AssessmentType)(HELPER_AssessmentType.readExternal (_AssessmentType, vals.get(FIELD_AssessmentType))); //
_PartTimeAssessmentType = (AssessmentType)(HELPER_PartTimeAssessmentType.readExternal (_PartTimeAssessmentType, vals.get(FIELD_PartTimeAssessmentType))); //
_AssessmentLevel.readExternalData(vals.get(SINGLEREFERENCE_AssessmentLevel)); _AssessmentLevel.readExternalData(vals.get(SINGLEREFERENCE_AssessmentLevel));
_ExpressAssessmentLevel.readExternalData(vals.get(SINGLEREFERENCE_ExpressAssessmentLevel));
_ParentOccupation.readExternalData(vals.get(SINGLEREFERENCE_ParentOccupation)); _ParentOccupation.readExternalData(vals.get(SINGLEREFERENCE_ParentOccupation));
_ChildOccupations.readExternalData(vals.get(MULTIPLEREFERENCE_ChildOccupations)); _ChildOccupations.readExternalData(vals.get(MULTIPLEREFERENCE_ChildOccupations));
...@@ -1508,7 +1781,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1508,7 +1781,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
vals.put (FIELD_Name, HELPER_Name.writeExternal (_Name)); vals.put (FIELD_Name, HELPER_Name.writeExternal (_Name));
vals.put (FIELD_Level, HELPER_Level.writeExternal (_Level)); vals.put (FIELD_Level, HELPER_Level.writeExternal (_Level));
vals.put (FIELD_AssessmentType, HELPER_AssessmentType.writeExternal (_AssessmentType)); vals.put (FIELD_AssessmentType, HELPER_AssessmentType.writeExternal (_AssessmentType));
vals.put (FIELD_PartTimeAssessmentType, HELPER_PartTimeAssessmentType.writeExternal (_PartTimeAssessmentType));
vals.put (SINGLEREFERENCE_AssessmentLevel, _AssessmentLevel.writeExternalData()); vals.put (SINGLEREFERENCE_AssessmentLevel, _AssessmentLevel.writeExternalData());
vals.put (SINGLEREFERENCE_ExpressAssessmentLevel, _ExpressAssessmentLevel.writeExternalData());
vals.put (SINGLEREFERENCE_ParentOccupation, _ParentOccupation.writeExternalData()); vals.put (SINGLEREFERENCE_ParentOccupation, _ParentOccupation.writeExternalData());
vals.put (MULTIPLEREFERENCE_ChildOccupations, _ChildOccupations.writeExternalData()); vals.put (MULTIPLEREFERENCE_ChildOccupations, _ChildOccupations.writeExternalData());
...@@ -1540,9 +1815,14 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1540,9 +1815,14 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
listener.notifyFieldChange(this, other, FIELD_AssessmentType, HELPER_AssessmentType.toObject(this._AssessmentType), HELPER_AssessmentType.toObject(otherOccupation._AssessmentType)); listener.notifyFieldChange(this, other, FIELD_AssessmentType, HELPER_AssessmentType.toObject(this._AssessmentType), HELPER_AssessmentType.toObject(otherOccupation._AssessmentType));
} }
if (!HELPER_PartTimeAssessmentType.compare(this._PartTimeAssessmentType, otherOccupation._PartTimeAssessmentType))
{
listener.notifyFieldChange(this, other, FIELD_PartTimeAssessmentType, HELPER_PartTimeAssessmentType.toObject(this._PartTimeAssessmentType), HELPER_PartTimeAssessmentType.toObject(otherOccupation._PartTimeAssessmentType));
}
// Compare single assocs // Compare single assocs
_AssessmentLevel.compare (otherOccupation._AssessmentLevel, listener); _AssessmentLevel.compare (otherOccupation._AssessmentLevel, listener);
_ExpressAssessmentLevel.compare (otherOccupation._ExpressAssessmentLevel, listener);
_ParentOccupation.compare (otherOccupation._ParentOccupation, listener); _ParentOccupation.compare (otherOccupation._ParentOccupation, listener);
...@@ -1569,7 +1849,9 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1569,7 +1849,9 @@ public abstract class BaseOccupation extends BaseBusinessClass
visitor.visitField(this, FIELD_Name, HELPER_Name.toObject(getName())); visitor.visitField(this, FIELD_Name, HELPER_Name.toObject(getName()));
visitor.visitField(this, FIELD_Level, HELPER_Level.toObject(getLevel())); visitor.visitField(this, FIELD_Level, HELPER_Level.toObject(getLevel()));
visitor.visitField(this, FIELD_AssessmentType, HELPER_AssessmentType.toObject(getAssessmentType())); visitor.visitField(this, FIELD_AssessmentType, HELPER_AssessmentType.toObject(getAssessmentType()));
visitor.visitField(this, FIELD_PartTimeAssessmentType, HELPER_PartTimeAssessmentType.toObject(getPartTimeAssessmentType()));
visitor.visitAssociation (_AssessmentLevel); visitor.visitAssociation (_AssessmentLevel);
visitor.visitAssociation (_ExpressAssessmentLevel);
visitor.visitAssociation (_ParentOccupation); visitor.visitAssociation (_ParentOccupation);
visitor.visitAssociation (_ChildOccupations); visitor.visitAssociation (_ChildOccupations);
...@@ -1584,6 +1866,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1584,6 +1866,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
visitor.visit (_AssessmentLevel); visitor.visit (_AssessmentLevel);
} }
if (scope.includes (_ExpressAssessmentLevel))
{
visitor.visit (_ExpressAssessmentLevel);
}
if (scope.includes (_ParentOccupation)) if (scope.includes (_ParentOccupation))
{ {
visitor.visit (_ParentOccupation); visitor.visit (_ParentOccupation);
...@@ -1633,10 +1919,18 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1633,10 +1919,18 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return filter.matches (getAssessmentType ()); return filter.matches (getAssessmentType ());
} }
else if (attribName.equals (FIELD_PartTimeAssessmentType))
{
return filter.matches (getPartTimeAssessmentType ());
}
else if (attribName.equals (SINGLEREFERENCE_AssessmentLevel)) else if (attribName.equals (SINGLEREFERENCE_AssessmentLevel))
{ {
return filter.matches (getAssessmentLevel ()); return filter.matches (getAssessmentLevel ());
} }
else if (attribName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return filter.matches (getExpressAssessmentLevel ());
}
else if (attribName.equals (SINGLEREFERENCE_ParentOccupation)) else if (attribName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return filter.matches (getParentOccupation ()); return filter.matches (getParentOccupation ());
...@@ -1696,12 +1990,24 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1696,12 +1990,24 @@ public abstract class BaseOccupation extends BaseBusinessClass
return this; return this;
} }
public SearchAll andPartTimeAssessmentType (QueryFilter<AssessmentType> filter)
{
filter.addFilter (context, "tl_occupation.parttime_assessment_type", "PartTimeAssessmentType");
return this;
}
public SearchAll andAssessmentLevel (QueryFilter<Level> filter) public SearchAll andAssessmentLevel (QueryFilter<Level> filter)
{ {
filter.addFilter (context, "tl_occupation.assessment_level_id", "AssessmentLevel"); filter.addFilter (context, "tl_occupation.assessment_level_id", "AssessmentLevel");
return this; return this;
} }
public SearchAll andExpressAssessmentLevel (QueryFilter<Level> filter)
{
filter.addFilter (context, "tl_occupation.express_assessment_level_id", "ExpressAssessmentLevel");
return this;
}
public SearchAll andParentOccupation (QueryFilter<Occupation> filter) public SearchAll andParentOccupation (QueryFilter<Occupation> filter)
{ {
filter.addFilter (context, "tl_occupation.parent_occupation_id", "ParentOccupation"); filter.addFilter (context, "tl_occupation.parent_occupation_id", "ParentOccupation");
...@@ -1759,6 +2065,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1759,6 +2065,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return HELPER_AssessmentType.toObject (getAssessmentType ()); return HELPER_AssessmentType.toObject (getAssessmentType ());
} }
else if (attribName.equals (FIELD_PartTimeAssessmentType))
{
return HELPER_PartTimeAssessmentType.toObject (getPartTimeAssessmentType ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -1788,6 +2098,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1788,6 +2098,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return HELPER_AssessmentType; return HELPER_AssessmentType;
} }
else if (attribName.equals (FIELD_PartTimeAssessmentType))
{
return HELPER_PartTimeAssessmentType;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -1817,6 +2131,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1817,6 +2131,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
setAssessmentType ((AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, attribValue))); setAssessmentType ((AssessmentType)(HELPER_AssessmentType.fromObject (_AssessmentType, attribValue)));
} }
else if (attribName.equals (FIELD_PartTimeAssessmentType))
{
setPartTimeAssessmentType ((AssessmentType)(HELPER_PartTimeAssessmentType.fromObject (_PartTimeAssessmentType, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -1853,6 +2171,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1853,6 +2171,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return getWriteability_AssessmentType (); return getWriteability_AssessmentType ();
} }
else if (fieldName.equals (FIELD_PartTimeAssessmentType))
{
return getWriteability_PartTimeAssessmentType ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_ChildOccupations)) else if (fieldName.equals (MULTIPLEREFERENCE_ChildOccupations))
{ {
return getWriteability_ChildOccupations (); return getWriteability_ChildOccupations ();
...@@ -1861,6 +2183,10 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1861,6 +2183,10 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return getWriteability_AssessmentLevel (); return getWriteability_AssessmentLevel ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ExpressAssessmentLevel))
{
return getWriteability_ExpressAssessmentLevel ();
}
else if (fieldName.equals (SINGLEREFERENCE_ParentOccupation)) else if (fieldName.equals (SINGLEREFERENCE_ParentOccupation))
{ {
return getWriteability_ParentOccupation (); return getWriteability_ParentOccupation ();
...@@ -1895,6 +2221,11 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1895,6 +2221,11 @@ public abstract class BaseOccupation extends BaseBusinessClass
fields.add (FIELD_AssessmentType); fields.add (FIELD_AssessmentType);
} }
if (getWriteability_PartTimeAssessmentType () != FieldWriteability.TRUE)
{
fields.add (FIELD_PartTimeAssessmentType);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -1908,6 +2239,7 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -1908,6 +2239,7 @@ public abstract class BaseOccupation extends BaseBusinessClass
result.add(HELPER_Name.getAttribObject (getClass (), _Name, true, FIELD_Name)); result.add(HELPER_Name.getAttribObject (getClass (), _Name, true, FIELD_Name));
result.add(HELPER_Level.getAttribObject (getClass (), _Level, true, FIELD_Level)); result.add(HELPER_Level.getAttribObject (getClass (), _Level, true, FIELD_Level));
result.add(HELPER_AssessmentType.getAttribObject (getClass (), _AssessmentType, false, FIELD_AssessmentType)); result.add(HELPER_AssessmentType.getAttribObject (getClass (), _AssessmentType, false, FIELD_AssessmentType));
result.add(HELPER_PartTimeAssessmentType.getAttribObject (getClass (), _PartTimeAssessmentType, false, FIELD_PartTimeAssessmentType));
return result; return result;
} }
...@@ -2030,6 +2362,24 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -2030,6 +2362,24 @@ public abstract class BaseOccupation extends BaseBusinessClass
return newAssessmentType; return newAssessmentType;
} }
/**
* Get the attribute PartTimeAssessmentType
*/
public AssessmentType getPartTimeAssessmentType (Occupation obj, AssessmentType original)
{
return original;
}
/**
* Change the value set for attribute PartTimeAssessmentType.
* May modify the field beforehand
* Occurs before validation.
*/
public AssessmentType setPartTimeAssessmentType (Occupation obj, AssessmentType newPartTimeAssessmentType) throws FieldException
{
return newPartTimeAssessmentType;
}
} }
...@@ -2102,10 +2452,18 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -2102,10 +2452,18 @@ public abstract class BaseOccupation extends BaseBusinessClass
{ {
return toAssessmentType (); return toAssessmentType ();
} }
if (name.equals ("PartTimeAssessmentType"))
{
return toPartTimeAssessmentType ();
}
if (name.equals ("AssessmentLevel")) if (name.equals ("AssessmentLevel"))
{ {
return toAssessmentLevel (); return toAssessmentLevel ();
} }
if (name.equals ("ExpressAssessmentLevel"))
{
return toExpressAssessmentLevel ();
}
if (name.equals ("ParentOccupation")) if (name.equals ("ParentOccupation"))
{ {
return toParentOccupation (); return toParentOccupation ();
...@@ -2123,12 +2481,20 @@ public abstract class BaseOccupation extends BaseBusinessClass ...@@ -2123,12 +2481,20 @@ public abstract class BaseOccupation extends BaseBusinessClass
public PipeLine<From, OccupationLevel> toLevel () { return pipe(new ORMAttributePipe<Me, OccupationLevel>(FIELD_Level)); } public PipeLine<From, OccupationLevel> toLevel () { return pipe(new ORMAttributePipe<Me, OccupationLevel>(FIELD_Level)); }
public PipeLine<From, AssessmentType> toAssessmentType () { return pipe(new ORMAttributePipe<Me, AssessmentType>(FIELD_AssessmentType)); } public PipeLine<From, AssessmentType> toAssessmentType () { return pipe(new ORMAttributePipe<Me, AssessmentType>(FIELD_AssessmentType)); }
public PipeLine<From, AssessmentType> toPartTimeAssessmentType () { return pipe(new ORMAttributePipe<Me, AssessmentType>(FIELD_PartTimeAssessmentType)); }
public Level.LevelPipeLineFactory<From, Level> toAssessmentLevel () { return toAssessmentLevel (Filter.ALL); } public Level.LevelPipeLineFactory<From, Level> toAssessmentLevel () { return toAssessmentLevel (Filter.ALL); }
public Level.LevelPipeLineFactory<From, Level> toAssessmentLevel (Filter<Level> filter) public Level.LevelPipeLineFactory<From, Level> toAssessmentLevel (Filter<Level> filter)
{ {
return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_AssessmentLevel, filter)); return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_AssessmentLevel, filter));
} }
public Level.LevelPipeLineFactory<From, Level> toExpressAssessmentLevel () { return toExpressAssessmentLevel (Filter.ALL); }
public Level.LevelPipeLineFactory<From, Level> toExpressAssessmentLevel (Filter<Level> filter)
{
return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_ExpressAssessmentLevel, filter));
}
public Occupation.OccupationPipeLineFactory<From, Occupation> toParentOccupation () { return toParentOccupation (Filter.ALL); } public Occupation.OccupationPipeLineFactory<From, Occupation> toParentOccupation () { return toParentOccupation (Filter.ALL); }
public Occupation.OccupationPipeLineFactory<From, Occupation> toParentOccupation (Filter<Occupation> filter) public Occupation.OccupationPipeLineFactory<From, Occupation> toParentOccupation (Filter<Occupation> filter)
...@@ -2186,6 +2552,20 @@ class DummyOccupation extends Occupation ...@@ -2186,6 +2552,20 @@ class DummyOccupation extends Occupation
return Level.DUMMY_Level.getObjectID(); return Level.DUMMY_Level.getObjectID();
} }
public Level getExpressAssessmentLevel () throws StorageException
{
return (Level)(Level.DUMMY_Level);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getExpressAssessmentLevelID ()
{
return Level.DUMMY_Level.getObjectID();
}
public Occupation getParentOccupation () throws StorageException public Occupation getParentOccupation () throws StorageException
{ {
return (Occupation)(Occupation.DUMMY_Occupation); return (Occupation)(Occupation.DUMMY_Occupation);
......
package performa.orm; package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.types.*;
public class ILOJobTitle extends BaseILOJobTitle public class ILOJobTitle extends BaseILOJobTitle
{ {
...@@ -31,5 +19,4 @@ public class ILOJobTitle extends BaseILOJobTitle ...@@ -31,5 +19,4 @@ public class ILOJobTitle extends BaseILOJobTitle
return StringUtils.subNulls(getJobTitle(), super.getToString()); return StringUtils.subNulls(getJobTitle(), super.getToString());
} }
} }
\ No newline at end of file
...@@ -744,12 +744,44 @@ public class Job extends BaseJob ...@@ -744,12 +744,44 @@ public class Job extends BaseJob
if(occupation != null) if(occupation != null)
{ {
setOccupation(occupation); setOccupation(occupation);
setLevel(occupation.getAssessmentLevel()); setSuggestedAssessmentType(getJobType() == JobType.FULL_TIME ? occupation.getAssessmentType() : occupation.getPartTimeAssessmentType());
setAssessmentType(occupation.getAssessmentType()); setAssessmentType(getJobType() == JobType.FULL_TIME ? occupation.getAssessmentType() : occupation.getPartTimeAssessmentType());
setLevel(getAssessmentType() == AssessmentType.COMPREHENSIVE ? occupation.getAssessmentLevel() : occupation.getExpressAssessmentLevel());
} }
super.postILOJobTitleChange(); super.postILOJobTitleChange();
} }
@Override
protected void postJobTypeChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
if(occupation != null)
{
setSuggestedAssessmentType(getJobType() == JobType.FULL_TIME ? occupation.getAssessmentType() : occupation.getPartTimeAssessmentType());
setAssessmentType(getJobType() == JobType.FULL_TIME ? occupation.getAssessmentType() : occupation.getPartTimeAssessmentType());
setLevel(getAssessmentType() == AssessmentType.COMPREHENSIVE ? occupation.getAssessmentLevel() : occupation.getExpressAssessmentLevel());
}
super.postJobTypeChange();
}
@Override
public AssessmentType getSuggestedAssessmentType()
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
if(occupation != null)
{
return getJobType() == JobType.FULL_TIME ? occupation.getAssessmentType() : occupation.getPartTimeAssessmentType();
}
return super.getSuggestedAssessmentType();
}
public Occupation displayOccupation() public Occupation displayOccupation()
{ {
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<TRANSIENT name="AssessmentTemplateName" type="String"/> <TRANSIENT name="AssessmentTemplateName" type="String"/>
<TRANSIENT name="CultureTemplateName" type="String"/> <TRANSIENT name="CultureTemplateName" type="String"/>
<TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/> <TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="SuggestedAssessmentType" type="AssessmentType" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="RankingCompleted" type="Boolean" /> <TRANSIENT name="RankingCompleted" type="Boolean" />
<TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" /> <TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" />
......
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
<MULTIPLEREFERENCE name="ChildOccupations" type="Occupation" backreferenceName="ParentOccupation" /> <MULTIPLEREFERENCE name="ChildOccupations" type="Occupation" backreferenceName="ParentOccupation" />
<TABLE name="tl_occupation" tablePrefix="object" polymorphic="FALSE"> <TABLE name="tl_occupation" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Code" type="String" dbcol="code" length="4" mandatory="true" isUnique="true"/> <ATTRIB name="Code" type="String" dbcol="code" length="4" mandatory="true" isUnique="true"/>
<ATTRIB name="Name" type="String" dbcol="name" length="250" mandatory="true"/> <ATTRIB name="Name" type="String" dbcol="name" length="250" mandatory="true"/>
<ATTRIB name="Level" type="OccupationLevel" dbcol="level" attribHelper="EnumeratedAttributeHelper" mandatory="true"/> <ATTRIB name="Level" type="OccupationLevel" dbcol="level" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" /> <ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="PartTimeAssessmentType" type="AssessmentType" dbcol="parttime_assessment_type" attribHelper="EnumeratedAttributeHelper" />
<SINGLEREFERENCE name="AssessmentLevel" type="Level" dbcol="assessment_level_id" />
<SINGLEREFERENCE name="ParentOccupation" type="Occupation" dbcol="parent_occupation_id" backreferenceName="ChildOccupations"/> <SINGLEREFERENCE name="AssessmentLevel" type="Level" dbcol="assessment_level_id" />
<SINGLEREFERENCE name="ExpressAssessmentLevel" type="Level" dbcol="express_assessment_level_id" />
<SINGLEREFERENCE name="ParentOccupation" type="Occupation" dbcol="parent_occupation_id" backreferenceName="ChildOccupations"/>
</TABLE> </TABLE>
<SEARCH type="All" paramFilter="object_id is not null" orderBy="object_id"/> <SEARCH type="All" paramFilter="object_id is not null" orderBy="object_id"/>
......
...@@ -31,6 +31,7 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -31,6 +31,7 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
private String dummyName; private String dummyName;
private OccupationLevel dummyLevel; private OccupationLevel dummyLevel;
private AssessmentType dummyAssessmentType; private AssessmentType dummyAssessmentType;
private AssessmentType dummyPartTimeAssessmentType;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -38,6 +39,7 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -38,6 +39,7 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_Name = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_Name = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_Level = new EnumeratedAttributeHelper (OccupationLevel.FACTORY_OccupationLevel); private static final EnumeratedAttributeHelper HELPER_Level = new EnumeratedAttributeHelper (OccupationLevel.FACTORY_OccupationLevel);
private static final EnumeratedAttributeHelper HELPER_AssessmentType = new EnumeratedAttributeHelper (AssessmentType.FACTORY_AssessmentType); private static final EnumeratedAttributeHelper HELPER_AssessmentType = new EnumeratedAttributeHelper (AssessmentType.FACTORY_AssessmentType);
private static final EnumeratedAttributeHelper HELPER_PartTimeAssessmentType = new EnumeratedAttributeHelper (AssessmentType.FACTORY_AssessmentType);
...@@ -48,10 +50,11 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -48,10 +50,11 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
dummyName = (String)(HELPER_Name.initialise (dummyName)); dummyName = (String)(HELPER_Name.initialise (dummyName));
dummyLevel = (OccupationLevel)(HELPER_Level.initialise (dummyLevel)); dummyLevel = (OccupationLevel)(HELPER_Level.initialise (dummyLevel));
dummyAssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (dummyAssessmentType)); dummyAssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (dummyAssessmentType));
dummyPartTimeAssessmentType = (AssessmentType)(HELPER_PartTimeAssessmentType.initialise (dummyPartTimeAssessmentType));
} }
private String SELECT_COLUMNS = "{PREFIX}tl_occupation.object_id as id, {PREFIX}tl_occupation.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_occupation.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_occupation.code, {PREFIX}tl_occupation.name, {PREFIX}tl_occupation.level, {PREFIX}tl_occupation.assessment_type, {PREFIX}tl_occupation.assessment_level_id, {PREFIX}tl_occupation.parent_occupation_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_occupation.object_id as id, {PREFIX}tl_occupation.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_occupation.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_occupation.code, {PREFIX}tl_occupation.name, {PREFIX}tl_occupation.level, {PREFIX}tl_occupation.assessment_type, {PREFIX}tl_occupation.parttime_assessment_type, {PREFIX}tl_occupation.assessment_level_id, {PREFIX}tl_occupation.express_assessment_level_id, {PREFIX}tl_occupation.parent_occupation_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
...@@ -106,7 +109,9 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -106,7 +109,9 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
!tl_occupationPSet.containsAttrib(Occupation.FIELD_Name)|| !tl_occupationPSet.containsAttrib(Occupation.FIELD_Name)||
!tl_occupationPSet.containsAttrib(Occupation.FIELD_Level)|| !tl_occupationPSet.containsAttrib(Occupation.FIELD_Level)||
!tl_occupationPSet.containsAttrib(Occupation.FIELD_AssessmentType)|| !tl_occupationPSet.containsAttrib(Occupation.FIELD_AssessmentType)||
!tl_occupationPSet.containsAttrib(Occupation.FIELD_PartTimeAssessmentType)||
!tl_occupationPSet.containsAttrib(Occupation.SINGLEREFERENCE_AssessmentLevel)|| !tl_occupationPSet.containsAttrib(Occupation.SINGLEREFERENCE_AssessmentLevel)||
!tl_occupationPSet.containsAttrib(Occupation.SINGLEREFERENCE_ExpressAssessmentLevel)||
!tl_occupationPSet.containsAttrib(Occupation.SINGLEREFERENCE_ParentOccupation)) !tl_occupationPSet.containsAttrib(Occupation.SINGLEREFERENCE_ParentOccupation))
{ {
// We will need to retrieve it // We will need to retrieve it
...@@ -187,10 +192,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -187,10 +192,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_occupation " + "UPDATE {PREFIX}tl_occupation " +
"SET code = ?, name = ?, level = ?, assessment_type = ?, assessment_level_id = ? , parent_occupation_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET code = ?, name = ?, level = ?, assessment_type = ?, parttime_assessment_type = ?, assessment_level_id = ? , express_assessment_level_id = ? , parent_occupation_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_occupation.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_occupation.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Code.getForSQL(dummyCode, tl_occupationPSet.getAttrib (Occupation.FIELD_Code))).listEntry (HELPER_Name.getForSQL(dummyName, tl_occupationPSet.getAttrib (Occupation.FIELD_Name))).listEntry (HELPER_Level.getForSQL(dummyLevel, tl_occupationPSet.getAttrib (Occupation.FIELD_Level))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_AssessmentType))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_AssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ParentOccupation)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Code.getForSQL(dummyCode, tl_occupationPSet.getAttrib (Occupation.FIELD_Code))).listEntry (HELPER_Name.getForSQL(dummyName, tl_occupationPSet.getAttrib (Occupation.FIELD_Name))).listEntry (HELPER_Level.getForSQL(dummyLevel, tl_occupationPSet.getAttrib (Occupation.FIELD_Level))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_AssessmentType))).listEntry (HELPER_PartTimeAssessmentType.getForSQL(dummyPartTimeAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_PartTimeAssessmentType))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_AssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ExpressAssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ParentOccupation)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -450,8 +455,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -450,8 +455,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
tl_occupationPSet.setAttrib(Occupation.FIELD_Name, HELPER_Name.getFromRS(dummyName, r, "name")); tl_occupationPSet.setAttrib(Occupation.FIELD_Name, HELPER_Name.getFromRS(dummyName, r, "name"));
tl_occupationPSet.setAttrib(Occupation.FIELD_Level, HELPER_Level.getFromRS(dummyLevel, r, "level")); tl_occupationPSet.setAttrib(Occupation.FIELD_Level, HELPER_Level.getFromRS(dummyLevel, r, "level"));
tl_occupationPSet.setAttrib(Occupation.FIELD_AssessmentType, HELPER_AssessmentType.getFromRS(dummyAssessmentType, r, "assessment_type")); tl_occupationPSet.setAttrib(Occupation.FIELD_AssessmentType, HELPER_AssessmentType.getFromRS(dummyAssessmentType, r, "assessment_type"));
tl_occupationPSet.setAttrib(Occupation.FIELD_PartTimeAssessmentType, HELPER_PartTimeAssessmentType.getFromRS(dummyPartTimeAssessmentType, r, "parttime_assessment_type"));
tl_occupationPSet.setAttrib(Occupation.SINGLEREFERENCE_AssessmentLevel, r.getObject ("assessment_level_id")); tl_occupationPSet.setAttrib(Occupation.SINGLEREFERENCE_AssessmentLevel, r.getObject ("assessment_level_id"));
tl_occupationPSet.setAttrib(Occupation.SINGLEREFERENCE_ExpressAssessmentLevel, r.getObject ("express_assessment_level_id"));
tl_occupationPSet.setAttrib(Occupation.SINGLEREFERENCE_ParentOccupation, r.getObject ("parent_occupation_id")); tl_occupationPSet.setAttrib(Occupation.SINGLEREFERENCE_ParentOccupation, r.getObject ("parent_occupation_id"));
} }
...@@ -469,10 +476,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr ...@@ -469,10 +476,10 @@ public class OccupationPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_occupation " + "INSERT INTO {PREFIX}tl_occupation " +
" (code, name, level, assessment_type, assessment_level_id, parent_occupation_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (code, name, level, assessment_type, parttime_assessment_type, assessment_level_id, express_assessment_level_id, parent_occupation_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_Code.getForSQL(dummyCode, tl_occupationPSet.getAttrib (Occupation.FIELD_Code))).listEntry (HELPER_Name.getForSQL(dummyName, tl_occupationPSet.getAttrib (Occupation.FIELD_Name))).listEntry (HELPER_Level.getForSQL(dummyLevel, tl_occupationPSet.getAttrib (Occupation.FIELD_Level))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_AssessmentType))) .listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_AssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ParentOccupation)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Code.getForSQL(dummyCode, tl_occupationPSet.getAttrib (Occupation.FIELD_Code))).listEntry (HELPER_Name.getForSQL(dummyName, tl_occupationPSet.getAttrib (Occupation.FIELD_Name))).listEntry (HELPER_Level.getForSQL(dummyLevel, tl_occupationPSet.getAttrib (Occupation.FIELD_Level))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_AssessmentType))).listEntry (HELPER_PartTimeAssessmentType.getForSQL(dummyPartTimeAssessmentType, tl_occupationPSet.getAttrib (Occupation.FIELD_PartTimeAssessmentType))) .listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_AssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ExpressAssessmentLevel)))).listEntry (SQLManager.CheckNull((Long)(tl_occupationPSet.getAttrib (Occupation.SINGLEREFERENCE_ParentOccupation)))) .listEntry (objectID.longID ()).toList().toArray());
tl_occupationPSet.setStatus (PersistentSetStatus.PROCESSED); tl_occupationPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
package performa.utils;
import oneit.utils.FormatterFactory;
import performa.orm.Job;
import performa.orm.types.AssessmentType;
public class AssessmentTypeEnumFormatter implements FormatterFactory
{
private Job job;
public AssessmentTypeEnumFormatter(Job job)
{
this.job = job;
}
@Override
public Object getFormatterFor(Object objectToFormat)
{
AssessmentType assessmentType = ((AssessmentType) objectToFormat);
if(job.getSuggestedAssessmentType() == assessmentType)
{
return assessmentType.getDescription() + " (Suggested)";
}
return assessmentType.getDescription();
}
}
\ No newline at end of file
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/> <INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE> </NODE>
<NODE name="assessment_type_selector_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE>
<NODE name="signin_jsp" factory="Participant"> <NODE name="signin_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/> <INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
......
<%@ page extends="oneit.servlets.process.AJAXProcessJSP" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ include file="/inc/std_imports.jsp" %>
<%! protected String getName (ServletConfig config) { return "assessment_type_selector_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job");
Long jobTitleID = request.getParameter("jobTitleID") != null ? Long.valueOf(request.getParameter("jobTitleID")) : null;
String jobTypeName = request.getParameter("jobTypeName");
if(jobTypeName != null)
{
JobType jobType = JobType.forName(jobTypeName);
job.setJobType(jobType);
}
if(jobTitleID != null)
{
ILOJobTitle jobTitle = ILOJobTitle.getILOJobTitleByID(objTran, jobTitleID);
job.setILOJobTitle(jobTitle);
}
%>
<oneit:form name="editJob" method="POST">
<oneit:evalBody buffer="<%= getBuffer(request) %>">
<oneit:ormEnum obj="<%= job %>" attributeName="AssessmentType" cssClass="form-control" enumFormatter="<%= new AssessmentTypeEnumFormatter(job) %>"/>
</oneit:evalBody>
</oneit:form>
...@@ -46,6 +46,24 @@ ...@@ -46,6 +46,24 @@
$("button[name$='loadJobFromTemplate']").click(); $("button[name$='loadJobFromTemplate']").click();
}); });
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').change(function()
{
$( "select[name$='AssessmentType']" ).remove();
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/adminportal/inc/assessment_type_selector.jsp", "#assessment_type", {jobTitleID : $('input[type="hidden"][id$="JobTitle"]').val()}, function (theHTML_JQ) {
$("#assessment_type").append (theHTML_JQ);
});
});
$("select[name$='JobType']").change(function()
{
$( "select[name$='AssessmentType']" ).remove();
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/adminportal/inc/assessment_type_selector.jsp", "#assessment_type", {jobTypeName : $(this).val()}, function (theHTML_JQ) {
$("#assessment_type").append (theHTML_JQ);
});
});
if ($("#select-occupation-id").val()) { if ($("#select-occupation-id").val()) {
lastclickedOccid = $("#select-occupation-id").val(); lastclickedOccid = $("#select-occupation-id").val();
}else { }else {
...@@ -164,6 +182,10 @@ ...@@ -164,6 +182,10 @@
$("#occupation span").addClass("form-control"); $("#occupation span").addClass("form-control");
$("#occupation span").css({"padding":"15px","display":"inline-table"}); $("#occupation span").css({"padding":"15px","display":"inline-table"});
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/adminportal/inc/assessment_type_selector.jsp", "#assessment_type", {}, function (theHTML_JQ) {
$("#assessment_type").append (theHTML_JQ);
});
}); });
...@@ -335,32 +357,6 @@ ...@@ -335,32 +357,6 @@
<label class="label-16">Job Location</label> <label class="label-16">Job Location</label>
</div> </div>
</div> </div>
<%--
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= job %>" field="Country" /></label>
<oneit:ormEnum obj="<%= job %>" attributeName="Country" cssClass="form-control"/>
</div>
<div class="col-md-6">
<label><oneit:label GUIName="State or Province"/></label>
<oneit:ormEnum obj="<%= job %>" attributeName="State" cssClass="form-control"/>
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<label><oneit:label GUIName="City or Town"/></label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="City" cssClass="form-control" />
</div>
<div class="col-md-4">
<label><oneit:label GUIName="Zip / Post Code"/></label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
<div class="col-md-4">
<label><oneit:label GUIName="Expected Candidate Radius"/></label>
<oneit:ormEnum obj="<%= job %>" attributeName="ExpectedCandidateRadius" cssClass="form-control"/>
</div>
</div>
--%>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-8"> <div class="col-md-8">
<label><oneit:label GUIName="Google Location"/></label> <label><oneit:label GUIName="Google Location"/></label>
...@@ -403,7 +399,6 @@ ...@@ -403,7 +399,6 @@
<oneit:recalc mode="EscapeHTML" script="job.displayOccupation()" job="<%= job %>"/> <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="Job Type" /></label> <label><oneit:label GUIName="Job Type" /></label>
...@@ -415,6 +410,12 @@ ...@@ -415,6 +410,12 @@
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6" id="assessment_type">
<label><oneit:label GUIName="Assessment Length" /></label>
</div>
</div>
<div class="form-group row">
<div class="col-md-12"> <div class="col-md-12">
<div class="styled_checkboxes"> <div class="styled_checkboxes">
<div class="checkbox checkbox-primary"> <div class="checkbox checkbox-primary">
......
<?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_occupation</tableName>
<column name="parttime_assessment_type" type="String" nullable="true" length="200"/>
<column name="express_assessment_level_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.
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