Commit 89880c0b by nilu

S36960674 # Client - Incoming Issues (raised by Client) #Add custom messaging

parent aa8a8b4e
......@@ -36,6 +36,7 @@
<column name="last_plan_amount" type="Double" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="plan_cancelled" type="Boolean" nullable="true"/>
<column name="message_id" type="Long" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="false"/>
<column name="billing_team_id" type="Long" length="11" nullable="true"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
......
......@@ -8,6 +8,7 @@
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="message_id" type="Long" nullable="false"/>
<column name="template_name" type="String" nullable="false" length="200"/>
<column name="subject" type="String" nullable="false" length="200"/>
<column name="application_status" type="String" nullable="false" length="200"/>
......
......@@ -36,6 +36,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
message_id numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -8,6 +8,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
message_id numeric(12) NOT NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount number(20,5) NULL,
google_address_text varchar2(300) NULL,
plan_cancelled char(1) NULL,
message_id number(12) NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
......
......@@ -9,6 +9,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
message_id number(12) NOT NULL,
template_name varchar2(200) NOT NULL,
subject varchar2(200) NOT NULL,
application_status varchar2(200) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
message_id numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -9,6 +9,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
message_id numeric(12) NOT NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
......
......@@ -70,6 +70,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
public static final String FIELD_LastPlanAmount = "LastPlanAmount";
public static final String FIELD_GoogleAddressText = "GoogleAddressText";
public static final String FIELD_PlanCancelled = "PlanCancelled";
public static final String FIELD_MessageID = "MessageID";
public static final String FIELD_IsLogoDeleted = "IsLogoDeleted";
public static final String FIELD_CouponCode = "CouponCode";
public static final String FIELD_StripeBrand = "StripeBrand";
......@@ -122,6 +123,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private static final DefaultAttributeHelper<HiringTeam> HELPER_LastPlanAmount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_PlanCancelled = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_MessageID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_IsLogoDeleted = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_CouponCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_StripeBrand = DefaultAttributeHelper.INSTANCE;
......@@ -157,6 +159,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private Double _LastPlanAmount;
private String _GoogleAddressText;
private Boolean _PlanCancelled;
private Integer _MessageID;
private Boolean _IsLogoDeleted;
private String _CouponCode;
private String _StripeBrand;
......@@ -213,6 +216,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private static final AttributeValidator[] FIELD_LastPlanAmount_Validators;
private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
private static final AttributeValidator[] FIELD_PlanCancelled_Validators;
private static final AttributeValidator[] FIELD_MessageID_Validators;
// Arrays of behaviour decorators
......@@ -271,6 +275,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
FIELD_LastPlanAmount_Validators = (AttributeValidator[])setupAttribMetaData_LastPlanAmount(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PlanCancelled_Validators = (AttributeValidator[])setupAttribMetaData_PlanCancelled(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageID_Validators = (AttributeValidator[])setupAttribMetaData_MessageID(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_HiringTeam.initialiseReference ();
......@@ -1014,6 +1019,24 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_MessageID(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_id");
metaInfo.put ("name", "MessageID");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for HiringTeam.MessageID:", metaInfo);
ATTRIBUTES_METADATA_HiringTeam.put (FIELD_MessageID, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(HiringTeam.class, "MessageID", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for HiringTeam.MessageID:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -1069,6 +1092,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.initialise (_LastPlanAmount));
_GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
_PlanCancelled = (Boolean)(Boolean.FALSE);
_MessageID = (Integer)(HELPER_MessageID.initialise (_MessageID));
_IsLogoDeleted = (Boolean)(Boolean.FALSE);
_CouponCode = (String)(HELPER_CouponCode.initialise (_CouponCode));
_StripeBrand = (String)(HELPER_StripeBrand.initialise (_StripeBrand));
......@@ -3859,6 +3883,104 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
}
/**
* Get the attribute MessageID
*/
public Integer getMessageID ()
{
assertValid();
Integer valToReturn = _MessageID;
for (HiringTeamBehaviourDecorator bhd : HiringTeam_BehaviourDecorators)
{
valToReturn = bhd.getMessageID ((HiringTeam)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 preMessageIDChange (Integer newMessageID) 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 postMessageIDChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageID ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageID. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageID (Integer newMessageID) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageID.compare (_MessageID, newMessageID);
try
{
for (HiringTeamBehaviourDecorator bhd : HiringTeam_BehaviourDecorators)
{
newMessageID = bhd.setMessageID ((HiringTeam)this, newMessageID);
oldAndNewIdentical = HELPER_MessageID.compare (_MessageID, newMessageID);
}
if (FIELD_MessageID_Validators.length > 0)
{
Object newMessageIDObj = HELPER_MessageID.toObject (newMessageID);
if (newMessageIDObj != null)
{
int loopMax = FIELD_MessageID_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_HiringTeam.get (FIELD_MessageID);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageID_Validators[v].checkAttribute (this, FIELD_MessageID, metadata, newMessageIDObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageID () != FieldWriteability.FALSE, "Field MessageID is not writeable");
preMessageIDChange (newMessageID);
markFieldChange (FIELD_MessageID);
_MessageID = newMessageID;
postFieldChange (FIELD_MessageID);
postMessageIDChange ();
}
}
/**
* Get the attribute IsLogoDeleted
*/
public Boolean getIsLogoDeleted ()
......@@ -5528,6 +5650,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
tl_hiring_teamPSet.setAttrib (FIELD_LastPlanAmount, HELPER_LastPlanAmount.toObject (_LastPlanAmount)); //
tl_hiring_teamPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
tl_hiring_teamPSet.setAttrib (FIELD_PlanCancelled, HELPER_PlanCancelled.toObject (_PlanCancelled)); //
tl_hiring_teamPSet.setAttrib (FIELD_MessageID, HELPER_MessageID.toObject (_MessageID)); //
_Company.getPersistentSets (allSets);
_BilledByTeam.getPersistentSets (allSets);
_AddedByUser.getPersistentSets (allSets);
......@@ -5575,6 +5698,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.fromObject (_LastPlanAmount, tl_hiring_teamPSet.getAttrib (FIELD_LastPlanAmount))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, tl_hiring_teamPSet.getAttrib (FIELD_GoogleAddressText))); //
_PlanCancelled = (Boolean)(HELPER_PlanCancelled.fromObject (_PlanCancelled, tl_hiring_teamPSet.getAttrib (FIELD_PlanCancelled))); //
_MessageID = (Integer)(HELPER_MessageID.fromObject (_MessageID, tl_hiring_teamPSet.getAttrib (FIELD_MessageID))); //
_Company.setFromPersistentSets (objectID, allSets);
_BilledByTeam.setFromPersistentSets (objectID, allSets);
_AddedByUser.setFromPersistentSets (objectID, allSets);
......@@ -5847,6 +5971,15 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
e.addException (ex);
}
try
{
setMessageID (otherHiringTeam.getMessageID ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -5890,6 +6023,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_LastPlanAmount = sourceHiringTeam._LastPlanAmount;
_GoogleAddressText = sourceHiringTeam._GoogleAddressText;
_PlanCancelled = sourceHiringTeam._PlanCancelled;
_MessageID = sourceHiringTeam._MessageID;
_IsLogoDeleted = sourceHiringTeam._IsLogoDeleted;
_CouponCode = sourceHiringTeam._CouponCode;
_StripeBrand = sourceHiringTeam._StripeBrand;
......@@ -5986,6 +6120,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.readExternal (_LastPlanAmount, vals.get(FIELD_LastPlanAmount))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
_PlanCancelled = (Boolean)(HELPER_PlanCancelled.readExternal (_PlanCancelled, vals.get(FIELD_PlanCancelled))); //
_MessageID = (Integer)(HELPER_MessageID.readExternal (_MessageID, vals.get(FIELD_MessageID))); //
_IsLogoDeleted = (Boolean)(HELPER_IsLogoDeleted.readExternal (_IsLogoDeleted, vals.get(FIELD_IsLogoDeleted))); //
_CouponCode = (String)(HELPER_CouponCode.readExternal (_CouponCode, vals.get(FIELD_CouponCode))); //
_StripeBrand = (String)(HELPER_StripeBrand.readExternal (_StripeBrand, vals.get(FIELD_StripeBrand))); //
......@@ -6037,6 +6172,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
vals.put (FIELD_LastPlanAmount, HELPER_LastPlanAmount.writeExternal (_LastPlanAmount));
vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
vals.put (FIELD_PlanCancelled, HELPER_PlanCancelled.writeExternal (_PlanCancelled));
vals.put (FIELD_MessageID, HELPER_MessageID.writeExternal (_MessageID));
vals.put (FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.writeExternal (_IsLogoDeleted));
vals.put (FIELD_CouponCode, HELPER_CouponCode.writeExternal (_CouponCode));
vals.put (FIELD_StripeBrand, HELPER_StripeBrand.writeExternal (_StripeBrand));
......@@ -6174,6 +6310,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_PlanCancelled, HELPER_PlanCancelled.toObject(this._PlanCancelled), HELPER_PlanCancelled.toObject(otherHiringTeam._PlanCancelled));
}
if (!HELPER_MessageID.compare(this._MessageID, otherHiringTeam._MessageID))
{
listener.notifyFieldChange(this, other, FIELD_MessageID, HELPER_MessageID.toObject(this._MessageID), HELPER_MessageID.toObject(otherHiringTeam._MessageID));
}
// Compare single assocs
_Company.compare (otherHiringTeam._Company, listener);
......@@ -6236,6 +6376,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
visitor.visitField(this, FIELD_LastPlanAmount, HELPER_LastPlanAmount.toObject(getLastPlanAmount()));
visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
visitor.visitField(this, FIELD_PlanCancelled, HELPER_PlanCancelled.toObject(getPlanCancelled()));
visitor.visitField(this, FIELD_MessageID, HELPER_MessageID.toObject(getMessageID()));
visitor.visitAssociation (_Company);
visitor.visitAssociation (_BilledByTeam);
visitor.visitAssociation (_AddedByUser);
......@@ -6421,6 +6562,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return filter.matches (getPlanCancelled ());
}
else if (attribName.equals (FIELD_MessageID))
{
return filter.matches (getMessageID ());
}
else if (attribName.equals (SINGLEREFERENCE_Company))
{
return filter.matches (getCompany ());
......@@ -6640,6 +6785,12 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
return this;
}
public SearchAll andMessageID (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_hiring_team.message_id", "MessageID");
return this;
}
public SearchAll andCompany (QueryFilter<Company> filter)
{
filter.addFilter (context, "tl_hiring_team.company_id", "Company");
......@@ -6889,6 +7040,12 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
return this;
}
public SearchBillingTeams andMessageID (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_hiring_team.message_id", "MessageID");
return this;
}
public SearchBillingTeams andCompany (QueryFilter<Company> filter)
{
filter.addFilter (context, "tl_hiring_team.company_id", "Company");
......@@ -7066,6 +7223,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return HELPER_PlanCancelled.toObject (getPlanCancelled ());
}
else if (attribName.equals (FIELD_MessageID))
{
return HELPER_MessageID.toObject (getMessageID ());
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
return HELPER_IsLogoDeleted.toObject (getIsLogoDeleted ());
......@@ -7207,6 +7368,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return HELPER_PlanCancelled;
}
else if (attribName.equals (FIELD_MessageID))
{
return HELPER_MessageID;
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
return HELPER_IsLogoDeleted;
......@@ -7348,6 +7513,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
setPlanCancelled ((Boolean)(HELPER_PlanCancelled.fromObject (_PlanCancelled, attribValue)));
}
else if (attribName.equals (FIELD_MessageID))
{
setMessageID ((Integer)(HELPER_MessageID.fromObject (_MessageID, attribValue)));
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
setIsLogoDeleted ((Boolean)(HELPER_IsLogoDeleted.fromObject (_IsLogoDeleted, attribValue)));
......@@ -7496,6 +7665,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return getWriteability_PlanCancelled ();
}
else if (fieldName.equals (FIELD_MessageID))
{
return getWriteability_MessageID ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Users))
{
return getWriteability_Users ();
......@@ -7694,6 +7867,11 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
fields.add (FIELD_PlanCancelled);
}
if (getWriteability_MessageID () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageID);
}
if (getWriteability_IsLogoDeleted () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsLogoDeleted);
......@@ -7751,6 +7929,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
result.add(HELPER_LastPlanAmount.getAttribObject (getClass (), _LastPlanAmount, false, FIELD_LastPlanAmount));
result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
result.add(HELPER_PlanCancelled.getAttribObject (getClass (), _PlanCancelled, false, FIELD_PlanCancelled));
result.add(HELPER_MessageID.getAttribObject (getClass (), _MessageID, false, FIELD_MessageID));
result.add(HELPER_IsLogoDeleted.getAttribObject (getClass (), _IsLogoDeleted, false, FIELD_IsLogoDeleted));
result.add(HELPER_CouponCode.getAttribObject (getClass (), _CouponCode, false, FIELD_CouponCode));
result.add(HELPER_StripeBrand.getAttribObject (getClass (), _StripeBrand, false, FIELD_StripeBrand));
......@@ -8328,6 +8507,24 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
}
/**
* Get the attribute MessageID
*/
public Integer getMessageID (HiringTeam obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute MessageID.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setMessageID (HiringTeam obj, Integer newMessageID) throws FieldException
{
return newMessageID;
}
/**
* Get the attribute IsLogoDeleted
*/
public Boolean getIsLogoDeleted (HiringTeam obj, Boolean original)
......@@ -8591,6 +8788,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return toPlanCancelled ();
}
if (name.equals ("MessageID"))
{
return toMessageID ();
}
if (name.equals ("Company"))
{
return toCompany ();
......@@ -8680,6 +8881,8 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); }
public PipeLine<From, Boolean> toPlanCancelled () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PlanCancelled)); }
public PipeLine<From, Integer> toMessageID () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_MessageID)); }
public Company.CompanyPipeLineFactory<From, Company> toCompany () { return toCompany (Filter.ALL); }
public Company.CompanyPipeLineFactory<From, Company> toCompany (Filter<Company> filter)
......
......@@ -41,6 +41,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
// Static constants corresponding to field names
public static final String FIELD_MessageID = "MessageID";
public static final String FIELD_TemplateName = "TemplateName";
public static final String FIELD_Subject = "Subject";
public static final String FIELD_ApplicationStatus = "ApplicationStatus";
......@@ -55,6 +56,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<MessageTemplate> HELPER_MessageID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_TemplateName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<MessageTemplate, ApplicationStatus> HELPER_ApplicationStatus = new EnumeratedAttributeHelper<MessageTemplate, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
......@@ -66,6 +68,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
// Private attributes corresponding to business object data
private Integer _MessageID;
private String _TemplateName;
private String _Subject;
private ApplicationStatus _ApplicationStatus;
......@@ -86,6 +89,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final Map ATTRIBUTES_METADATA_MessageTemplate = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_MessageID_Validators;
private static final AttributeValidator[] FIELD_TemplateName_Validators;
private static final AttributeValidator[] FIELD_Subject_Validators;
private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
......@@ -107,6 +111,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_MessageID_Validators = (AttributeValidator[])setupAttribMetaData_MessageID(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Subject_Validators = (AttributeValidator[])setupAttribMetaData_Subject(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
......@@ -130,6 +135,26 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
// Meta Info setup
private static List setupAttribMetaData_MessageID(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_id");
metaInfo.put ("defaultValue", "1");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "MessageID");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.MessageID:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_MessageID, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "MessageID", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.MessageID:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_TemplateName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
......@@ -316,6 +341,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
super._initialiseNewObjAttributes (transaction);
_MessageID = (Integer)(1);
_TemplateName = (String)(HELPER_TemplateName.initialise (_TemplateName));
_Subject = (String)(HELPER_Subject.initialise (_Subject));
_ApplicationStatus = (ApplicationStatus)(ApplicationStatus.DRAFT);
......@@ -349,6 +375,105 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
/**
* Get the attribute MessageID
*/
public Integer getMessageID ()
{
assertValid();
Integer valToReturn = _MessageID;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getMessageID ((MessageTemplate)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 preMessageIDChange (Integer newMessageID) 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 postMessageIDChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageID ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageID. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageID (Integer newMessageID) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageID.compare (_MessageID, newMessageID);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newMessageID = bhd.setMessageID ((MessageTemplate)this, newMessageID);
oldAndNewIdentical = HELPER_MessageID.compare (_MessageID, newMessageID);
}
BusinessObjectParser.assertFieldCondition (newMessageID != null, this, FIELD_MessageID, "mandatory");
if (FIELD_MessageID_Validators.length > 0)
{
Object newMessageIDObj = HELPER_MessageID.toObject (newMessageID);
if (newMessageIDObj != null)
{
int loopMax = FIELD_MessageID_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_MessageID);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageID_Validators[v].checkAttribute (this, FIELD_MessageID, metadata, newMessageIDObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageID () != FieldWriteability.FALSE, "Field MessageID is not writeable");
preMessageIDChange (newMessageID);
markFieldChange (FIELD_MessageID);
_MessageID = newMessageID;
postFieldChange (FIELD_MessageID);
postMessageIDChange ();
}
}
/**
* Get the attribute TemplateName
*/
public String getTemplateName ()
......@@ -1394,6 +1519,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
PersistentSet tl_message_templatePSet = allSets.getPersistentSet (myID, "tl_message_template", myPSetStatus);
tl_message_templatePSet.setAttrib (FIELD_ObjectID, myID);
tl_message_templatePSet.setAttrib (FIELD_MessageID, HELPER_MessageID.toObject (_MessageID)); //
tl_message_templatePSet.setAttrib (FIELD_TemplateName, HELPER_TemplateName.toObject (_TemplateName)); //
tl_message_templatePSet.setAttrib (FIELD_Subject, HELPER_Subject.toObject (_Subject)); //
tl_message_templatePSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
......@@ -1416,6 +1542,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
PersistentSet tl_message_templatePSet = allSets.getPersistentSet (objectID, "tl_message_template");
_MessageID = (Integer)(HELPER_MessageID.fromObject (_MessageID, tl_message_templatePSet.getAttrib (FIELD_MessageID))); //
_TemplateName = (String)(HELPER_TemplateName.fromObject (_TemplateName, tl_message_templatePSet.getAttrib (FIELD_TemplateName))); //
_Subject = (String)(HELPER_Subject.fromObject (_Subject, tl_message_templatePSet.getAttrib (FIELD_Subject))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_message_templatePSet.getAttrib (FIELD_ApplicationStatus))); //
......@@ -1441,6 +1568,15 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
try
{
setMessageID (otherMessageTemplate.getMessageID ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setTemplateName (otherMessageTemplate.getTemplateName ());
}
catch (FieldException ex)
......@@ -1526,6 +1662,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
BaseMessageTemplate sourceMessageTemplate = (BaseMessageTemplate)(source);
_MessageID = sourceMessageTemplate._MessageID;
_TemplateName = sourceMessageTemplate._TemplateName;
_Subject = sourceMessageTemplate._Subject;
_ApplicationStatus = sourceMessageTemplate._ApplicationStatus;
......@@ -1586,6 +1723,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
super.readExternalData(vals);
_MessageID = (Integer)(HELPER_MessageID.readExternal (_MessageID, vals.get(FIELD_MessageID))); //
_TemplateName = (String)(HELPER_TemplateName.readExternal (_TemplateName, vals.get(FIELD_TemplateName))); //
_Subject = (String)(HELPER_Subject.readExternal (_Subject, vals.get(FIELD_Subject))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
......@@ -1605,6 +1743,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
super.writeExternalData(vals);
vals.put (FIELD_MessageID, HELPER_MessageID.writeExternal (_MessageID));
vals.put (FIELD_TemplateName, HELPER_TemplateName.writeExternal (_TemplateName));
vals.put (FIELD_Subject, HELPER_Subject.writeExternal (_Subject));
vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
......@@ -1626,6 +1765,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
BaseMessageTemplate otherMessageTemplate = (BaseMessageTemplate)(other);
if (!HELPER_MessageID.compare(this._MessageID, otherMessageTemplate._MessageID))
{
listener.notifyFieldChange(this, other, FIELD_MessageID, HELPER_MessageID.toObject(this._MessageID), HELPER_MessageID.toObject(otherMessageTemplate._MessageID));
}
if (!HELPER_TemplateName.compare(this._TemplateName, otherMessageTemplate._TemplateName))
{
listener.notifyFieldChange(this, other, FIELD_TemplateName, HELPER_TemplateName.toObject(this._TemplateName), HELPER_TemplateName.toObject(otherMessageTemplate._TemplateName));
......@@ -1680,6 +1823,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_MessageID, HELPER_MessageID.toObject(getMessageID()));
visitor.visitField(this, FIELD_TemplateName, HELPER_TemplateName.toObject(getTemplateName()));
visitor.visitField(this, FIELD_Subject, HELPER_Subject.toObject(getSubject()));
visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
......@@ -1721,6 +1865,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageID))
{
return filter.matches (getMessageID ());
}
else if (attribName.equals (FIELD_TemplateName))
{
return filter.matches (getTemplateName ());
......@@ -1784,6 +1932,12 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
}
public SearchAll andMessageID (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_message_template.message_id", "MessageID");
return this;
}
public SearchAll andTemplateName (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_message_template.template_name", "TemplateName");
......@@ -1867,6 +2021,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageID))
{
return HELPER_MessageID.toObject (getMessageID ());
}
else if (attribName.equals (FIELD_TemplateName))
{
return HELPER_TemplateName.toObject (getTemplateName ());
......@@ -1912,6 +2070,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageID))
{
return HELPER_MessageID;
}
else if (attribName.equals (FIELD_TemplateName))
{
return HELPER_TemplateName;
......@@ -1957,6 +2119,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageID))
{
setMessageID ((Integer)(HELPER_MessageID.fromObject (_MessageID, attribValue)));
}
else if (attribName.equals (FIELD_TemplateName))
{
setTemplateName ((String)(HELPER_TemplateName.fromObject (_TemplateName, attribValue)));
......@@ -2009,6 +2175,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_MessageID))
{
return getWriteability_MessageID ();
}
else if (fieldName.equals (FIELD_TemplateName))
{
return getWriteability_TemplateName ();
......@@ -2051,6 +2221,11 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_MessageID () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageID);
}
if (getWriteability_TemplateName () != FieldWriteability.TRUE)
{
fields.add (FIELD_TemplateName);
......@@ -2100,6 +2275,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_MessageID.getAttribObject (getClass (), _MessageID, true, FIELD_MessageID));
result.add(HELPER_TemplateName.getAttribObject (getClass (), _TemplateName, true, FIELD_TemplateName));
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, true, FIELD_Subject));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
......@@ -2159,6 +2335,24 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
/**
* Get the attribute MessageID
*/
public Integer getMessageID (MessageTemplate obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute MessageID.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setMessageID (MessageTemplate obj, Integer newMessageID) throws FieldException
{
return newMessageID;
}
/**
* Get the attribute TemplateName
*/
public String getTemplateName (MessageTemplate obj, String original)
......@@ -2354,6 +2548,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("MessageID"))
{
return toMessageID ();
}
if (name.equals ("TemplateName"))
{
return toTemplateName ();
......@@ -2392,6 +2590,8 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
}
public PipeLine<From, Integer> toMessageID () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_MessageID)); }
public PipeLine<From, String> toTemplateName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_TemplateName)); }
public PipeLine<From, String> toSubject () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Subject)); }
......
......@@ -46,6 +46,7 @@
<ATTRIB name="LastPlanAmount" type="Double" dbcol="last_plan_amount" />
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300" />
<ATTRIB name="PlanCancelled" type="Boolean" dbcol="plan_cancelled" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" />
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" mandatory="true" backreferenceName="HiringTeams" />
<SINGLEREFERENCE name="BilledByTeam" type="HiringTeam" dbcol="billing_team_id" mandatory="false" backreferenceName="BillingTeams" />
......
......@@ -56,6 +56,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private Double dummyLastPlanAmount;
private String dummyGoogleAddressText;
private Boolean dummyPlanCancelled;
private Integer dummyMessageID;
// Static constants corresponding to attribute helpers
......@@ -87,6 +88,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_LastPlanAmount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PlanCancelled = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_MessageID = DefaultAttributeHelper.INSTANCE;
......@@ -121,10 +123,11 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
dummyLastPlanAmount = (Double)(HELPER_LastPlanAmount.initialise (dummyLastPlanAmount));
dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText));
dummyPlanCancelled = (Boolean)(HELPER_PlanCancelled.initialise (dummyPlanCancelled));
dummyMessageID = (Integer)(HELPER_MessageID.initialise (dummyMessageID));
}
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.plan_cancelled, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.plan_cancelled, {PREFIX}tl_hiring_team.message_id, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -203,6 +206,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_LastPlanAmount)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_GoogleAddressText)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_PlanCancelled)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_MessageID)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_Company)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_AddedByUser)||
......@@ -297,10 +301,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_hiring_team " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, plan_cancelled = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, plan_cancelled = ?, message_id = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_hiring_team.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -626,6 +630,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_LastPlanAmount, HELPER_LastPlanAmount.getFromRS(dummyLastPlanAmount, r, "last_plan_amount"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_PlanCancelled, HELPER_PlanCancelled.getFromRS(dummyPlanCancelled, r, "plan_cancelled"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_MessageID, HELPER_MessageID.getFromRS(dummyMessageID, r, "message_id"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_Company, r.getObject ("company_id"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam, r.getObject ("billing_team_id"));
......@@ -648,10 +653,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_hiring_team " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, plan_cancelled, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, plan_cancelled, message_id, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
tl_hiring_teamPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -52,7 +52,11 @@ public class JobApplication extends BaseJobApplication
});
// create scheduled emails for new application status
MessageTemplate[] templates = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(getApplicationStatus())).search(getTransaction());
int messageID = getJob().getHiringTeam().getMessageID() != null ? getJob().getHiringTeam().getMessageID() : 1;
MessageTemplate[] templates = MessageTemplate.SearchByAll()
.andApplicationStatus(new EqualsFilter<>(getApplicationStatus()))
.andMessageID(new EqualsFilter<>(messageID))
.search(getTransaction());
for(MessageTemplate template : templates)
......
......@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.*"/>
<TABLE name="tl_message_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" mandatory="true" defaultValue="1"/>
<ATTRIB name="TemplateName" type="String" dbcol="template_name" mandatory="true" length="200" />
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" defaultValue="ApplicationStatus.DRAFT" attribHelper="EnumeratedAttributeHelper" />
......
......@@ -28,6 +28,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
private static final LoggingArea MessageTemplatePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "MessageTemplate");
// Private attributes corresponding to business object data
private Integer dummyMessageID;
private String dummyTemplateName;
private String dummySubject;
private ApplicationStatus dummyApplicationStatus;
......@@ -39,6 +40,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_MessageID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_TemplateName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicationStatus = new EnumeratedAttributeHelper (ApplicationStatus.FACTORY_ApplicationStatus);
......@@ -53,6 +55,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
public MessageTemplatePersistenceMgr ()
{
dummyMessageID = (Integer)(HELPER_MessageID.initialise (dummyMessageID));
dummyTemplateName = (String)(HELPER_TemplateName.initialise (dummyTemplateName));
dummySubject = (String)(HELPER_Subject.initialise (dummySubject));
dummyApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (dummyApplicationStatus));
......@@ -64,7 +67,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
}
private String SELECT_COLUMNS = "{PREFIX}tl_message_template.object_id as id, {PREFIX}tl_message_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_message_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_message_template.template_name, {PREFIX}tl_message_template.subject, {PREFIX}tl_message_template.application_status, {PREFIX}tl_message_template.delay_hrs, {PREFIX}tl_message_template.delay_min, {PREFIX}tl_message_template.variance, {PREFIX}tl_message_template.business_hours_only, {PREFIX}tl_message_template.message_content, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_message_template.object_id as id, {PREFIX}tl_message_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_message_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_message_template.message_id, {PREFIX}tl_message_template.template_name, {PREFIX}tl_message_template.subject, {PREFIX}tl_message_template.application_status, {PREFIX}tl_message_template.delay_hrs, {PREFIX}tl_message_template.delay_min, {PREFIX}tl_message_template.variance, {PREFIX}tl_message_template.business_hours_only, {PREFIX}tl_message_template.message_content, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -115,6 +118,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
// Check for persistent sets already prefetched
if (false || !tl_message_templatePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_MessageID)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_TemplateName)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_Subject)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_ApplicationStatus)||
......@@ -192,10 +196,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_message_template " +
"SET template_name = ?, subject = ?, application_status = ?, delay_hrs = ?, delay_min = ?, variance = ?, business_hours_only = ?, message_content = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET message_id = ?, template_name = ?, subject = ?, application_status = ?, delay_hrs = ?, delay_min = ?, variance = ?, business_hours_only = ?, message_content = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_message_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -451,6 +455,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
// Object Created
tl_message_templatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_MessageID, HELPER_MessageID.getFromRS(dummyMessageID, r, "message_id"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_TemplateName, HELPER_TemplateName.getFromRS(dummyTemplateName, r, "template_name"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_Subject, HELPER_Subject.getFromRS(dummySubject, r, "subject"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
......@@ -476,10 +481,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_message_template " +
" (template_name, subject, application_status, delay_hrs, delay_min, variance, business_hours_only, message_content, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (message_id, template_name, subject, application_status, delay_hrs, delay_min, variance, business_hours_only, message_content, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))) .listEntry (objectID.longID ()).toList().toArray());
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -54,3 +54,4 @@ HiringTeam.HiringTeamLogo = Hiring Team Logo
HiringTeam.HiringTeamType = Hiring Team Type
HiringTeam.HiringTeamName = Hiring Team Name
HiringTeam.BilledByTeam = Billing Team
HiringTeam.MessageID = Message ID
......@@ -97,7 +97,7 @@
PopupAlert.close();
}else{
PopupAlert.setContent($("#force-to-choose-popup"));
PopupAlert.open();
PopupAlert.open();
return false;
}
......@@ -246,6 +246,16 @@
</div>
</div>
<%
if(Utils.isAssumedUser(request))
{
%>
<div class="form-group">
<label><oneit:ormlabel obj="<%= hiringTeam %>" field="MessageID" /></label>
<oneit:ormInput obj="<%= hiringTeam %>" type="text" attributeName="MessageID" cssClass="form-control"/>
</div>
<%
}
if(company.getHiringTeamsCount() > 1)
{
%>
......
......@@ -53,6 +53,15 @@
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="MessageID"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="MessageID"/>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="TemplateName"/>
</oneit:layout_label>
<oneit:layout_field width="1">
......
......@@ -3,4 +3,5 @@ MessageTemplate.ApplicationStatus = Application Status
MessageTemplate.MessageContent = Message Content
MessageTemplate.PlaceholderVariable = Placeholder Variable
MessageTemplate.DelayHrs = Delay
MessageTemplate.TemplateName = Template Name
\ No newline at end of file
MessageTemplate.TemplateName = Template Name
MessageTemplate.MessageID = Message ID
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_hiring_team</tableName>
<column name="message_id" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_message_template</tableName>
<column name="message_id" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
UPDATE tl_message_template SET message_id = 1 WHERE message_id IS NULL;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment