Commit e607fb3a by Nilu

fix multiple hiring team invitation

parent ff4ed2c1
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">it_does_not_matter</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="" type="Long" length="11" nullable="true"/>
<column name="" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="it_does_not_matter" indexName="idx_it_does_not_matter_" isUnique="false"><column name=""/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">it_does_not_matter</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="" type="CLOB" nullable="true"/>
<column name="" type="CLOB" nullable="true"/>
<column name="" type="CLOB" nullable="true"/>
<column name="" type="String" nullable="true" length="200"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
numeric(12) NULL,
numeric(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_it_does_not_matter_
ON it_does_not_matter ();
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
text NULL,
text NULL,
text NULL,
varchar(200) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
number(12) NULL,
number(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_it_does_not_matter_
ON it_does_not_matter ();
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
clob NULL,
clob NULL,
clob NULL,
varchar2(200) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
numeric(12) NULL,
numeric(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_it_does_not_matter_
ON it_does_not_matter ();
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
text NULL,
text NULL,
text NULL,
varchar(200) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.*;
import oneit.objstore.StorageException;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.utils.BusinessException;
import performa.orm.*;
public class AddAdditionalHiringTeamFP extends ORMProcessFormProcessor
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
InviteTeammateNPO inviteTeammate = (InviteTeammateNPO) process.getAttribute("InviteTeammate");
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1, "Inside AddAdditionalHiringTeamFP for ", inviteTeammate);
inviteTeammate.addToHiringTeams(HiringTeamLinkNPO.createHiringTeamLinkNPO(process.getTransaction()));
return RedisplayResult.getInstance();
}
}
\ No newline at end of file
...@@ -31,6 +31,7 @@ public class SendUserInvitationFP extends SaveFP ...@@ -31,6 +31,7 @@ public class SendUserInvitationFP extends SaveFP
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Company company = (Company) process.getAttribute("Company"); Company company = (Company) process.getAttribute("Company");
InviteTeammateNPO inviteTeammate = (InviteTeammateNPO) process.getAttribute("InviteTeammate");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser"); CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
if(resendUser!=null) if(resendUser!=null)
...@@ -39,9 +40,10 @@ public class SendUserInvitationFP extends SaveFP ...@@ -39,9 +40,10 @@ public class SendUserInvitationFP extends SaveFP
} }
else else
{ {
BusinessObjectParser.assertFieldCondition(company.getUserEmail()!=null, company, Company.FIELD_UserEmail, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(inviteTeammate.getUserEmail() != null, inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(company.getUserEmail()), company, Company.FIELD_UserEmail, "invalidEmail", exceptions, true, request); BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(inviteTeammate.getUserEmail()), inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "invalidEmail", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(company.getRoleType()!=null, company, Company.FIELD_RoleType, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(!Utils.userFoundInAnotherCompany(process.getTransaction(), inviteTeammate.getUserEmail() , company), inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "existsInOtherCompany", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(inviteTeammate.getRoleType() != null, inviteTeammate, InviteTeammateNPO.FIELD_RoleType, "mandatory", exceptions, true, request);
} }
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
...@@ -54,6 +56,7 @@ public class SendUserInvitationFP extends SaveFP ...@@ -54,6 +56,7 @@ public class SendUserInvitationFP extends SaveFP
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction(); ObjectTransaction objTran = process.getTransaction();
Company company = (Company) process.getAttribute("Company"); Company company = (Company) process.getAttribute("Company");
InviteTeammateNPO inviteTeammate = (InviteTeammateNPO) process.getAttribute("InviteTeammate");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser"); CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
HiringTeam hiringTeam = (HiringTeam) request.getAttribute("HiringTeam"); HiringTeam hiringTeam = (HiringTeam) request.getAttribute("HiringTeam");
...@@ -69,13 +72,13 @@ public class SendUserInvitationFP extends SaveFP ...@@ -69,13 +72,13 @@ public class SendUserInvitationFP extends SaveFP
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company); LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company);
SecUser secUser = SecUser.searchNAME(objTran, company.getUserEmail()); SecUser secUser = SecUser.searchNAME(objTran, inviteTeammate.getUserEmail());
if(secUser == null) if(secUser == null)
{ {
secUser = SecUser.createSecUser(objTran); secUser = SecUser.createSecUser(objTran);
secUser.setUserName(company.getUserEmail().toLowerCase()); secUser.setUserName(inviteTeammate.getUserEmail().toLowerCase());
} }
CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
...@@ -87,18 +90,29 @@ public class SendUserInvitationFP extends SaveFP ...@@ -87,18 +90,29 @@ public class SendUserInvitationFP extends SaveFP
secUser.setEmail(secUser.getUserName()); secUser.setEmail(secUser.getUserName());
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD); secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran)); secUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
secUser.setFirstName(company.getFirstName()); secUser.setFirstName(inviteTeammate.getFirstName());
secUser.setLastName(company.getLastName()); secUser.setLastName(inviteTeammate.getLastName());
comUser.setDefaultHiringTeam(hiringTeam); comUser.setDefaultHiringTeam(hiringTeam);
comUser.setCompany(company); comUser.setCompany(company);
} }
// setting the default hiring team selected above the screen
CompanyUserHiringTeamLink link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran); CompanyUserHiringTeamLink link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran);
link.setCompanyUser(comUser); link.setCompanyUser(comUser);
link.setHiringTeam(hiringTeam); link.setHiringTeam(hiringTeam);
comUser.setRole(company.getRoleType());
// setting additional hiring teams added when inviting
for (HiringTeamLinkNPO teamLinkNPO : inviteTeammate.getHiringTeamsSet())
{
CompanyUserHiringTeamLink teamLink = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran);
teamLink.setCompanyUser(comUser);
teamLink.setHiringTeam(teamLinkNPO.getHiringTeam());
}
comUser.setRole(inviteTeammate.getRoleType());
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser);
......
...@@ -64,10 +64,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -64,10 +64,6 @@ public abstract class BaseCompany extends BaseBusinessClass
public static final String FIELD_UsedCredits = "UsedCredits"; public static final String FIELD_UsedCredits = "UsedCredits";
public static final String FIELD_HiringTeamName = "HiringTeamName"; public static final String FIELD_HiringTeamName = "HiringTeamName";
public static final String FIELD_ManageOwnBilling = "ManageOwnBilling"; public static final String FIELD_ManageOwnBilling = "ManageOwnBilling";
public static final String FIELD_UserEmail = "UserEmail";
public static final String FIELD_FirstName = "FirstName";
public static final String FIELD_LastName = "LastName";
public static final String FIELD_RoleType = "RoleType";
public static final String FIELD_IsLogoDeleted = "IsLogoDeleted"; public static final String FIELD_IsLogoDeleted = "IsLogoDeleted";
public static final String FIELD_CompletedProfile = "CompletedProfile"; public static final String FIELD_CompletedProfile = "CompletedProfile";
public static final String FIELD_PaymentJobCount = "PaymentJobCount"; public static final String FIELD_PaymentJobCount = "PaymentJobCount";
...@@ -109,10 +105,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -109,10 +105,6 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final DefaultAttributeHelper<Company> HELPER_UsedCredits = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_UsedCredits = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_HiringTeamName = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_HiringTeamName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_ManageOwnBilling = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_ManageOwnBilling = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_UserEmail = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_LastName = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Company, RoleType> HELPER_RoleType = new EnumeratedAttributeHelper<Company, RoleType> (RoleType.FACTORY_RoleType);
private static final DefaultAttributeHelper<Company> HELPER_IsLogoDeleted = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_IsLogoDeleted = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_CompletedProfile = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_CompletedProfile = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_PaymentJobCount = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_PaymentJobCount = DefaultAttributeHelper.INSTANCE;
...@@ -141,10 +133,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -141,10 +133,6 @@ public abstract class BaseCompany extends BaseBusinessClass
private Integer _UsedCredits; private Integer _UsedCredits;
private String _HiringTeamName; private String _HiringTeamName;
private Boolean _ManageOwnBilling; private Boolean _ManageOwnBilling;
private String _UserEmail;
private String _FirstName;
private String _LastName;
private RoleType _RoleType;
private Boolean _IsLogoDeleted; private Boolean _IsLogoDeleted;
private Boolean _CompletedProfile; private Boolean _CompletedProfile;
private Integer _PaymentJobCount; private Integer _PaymentJobCount;
...@@ -171,10 +159,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -171,10 +159,6 @@ public abstract class BaseCompany extends BaseBusinessClass
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_HiringTeamName_Validators; private static final AttributeValidator[] FIELD_HiringTeamName_Validators;
private static final AttributeValidator[] FIELD_ManageOwnBilling_Validators; private static final AttributeValidator[] FIELD_ManageOwnBilling_Validators;
private static final AttributeValidator[] FIELD_UserEmail_Validators;
private static final AttributeValidator[] FIELD_FirstName_Validators;
private static final AttributeValidator[] FIELD_LastName_Validators;
private static final AttributeValidator[] FIELD_RoleType_Validators;
private static final AttributeValidator[] FIELD_IsLogoDeleted_Validators; private static final AttributeValidator[] FIELD_IsLogoDeleted_Validators;
private static final AttributeValidator[] FIELD_CompletedProfile_Validators; private static final AttributeValidator[] FIELD_CompletedProfile_Validators;
private static final AttributeValidator[] FIELD_PaymentJobCount_Validators; private static final AttributeValidator[] FIELD_PaymentJobCount_Validators;
...@@ -223,10 +207,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -223,10 +207,6 @@ public abstract class BaseCompany extends BaseBusinessClass
setupAssocMetaData_PaymentPlan(); setupAssocMetaData_PaymentPlan();
FIELD_HiringTeamName_Validators = (AttributeValidator[])setupAttribMetaData_HiringTeamName(validatorMapping).toArray (new AttributeValidator[0]); FIELD_HiringTeamName_Validators = (AttributeValidator[])setupAttribMetaData_HiringTeamName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ManageOwnBilling_Validators = (AttributeValidator[])setupAttribMetaData_ManageOwnBilling(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ManageOwnBilling_Validators = (AttributeValidator[])setupAttribMetaData_ManageOwnBilling(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_UserEmail_Validators = (AttributeValidator[])setupAttribMetaData_UserEmail(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_FirstName_Validators = (AttributeValidator[])setupAttribMetaData_FirstName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_LastName_Validators = (AttributeValidator[])setupAttribMetaData_LastName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RoleType_Validators = (AttributeValidator[])setupAttribMetaData_RoleType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsLogoDeleted_Validators = (AttributeValidator[])setupAttribMetaData_IsLogoDeleted(validatorMapping).toArray (new AttributeValidator[0]); FIELD_IsLogoDeleted_Validators = (AttributeValidator[])setupAttribMetaData_IsLogoDeleted(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_CompletedProfile_Validators = (AttributeValidator[])setupAttribMetaData_CompletedProfile(validatorMapping).toArray (new AttributeValidator[0]); FIELD_CompletedProfile_Validators = (AttributeValidator[])setupAttribMetaData_CompletedProfile(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PaymentJobCount_Validators = (AttributeValidator[])setupAttribMetaData_PaymentJobCount(validatorMapping).toArray (new AttributeValidator[0]); FIELD_PaymentJobCount_Validators = (AttributeValidator[])setupAttribMetaData_PaymentJobCount(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -398,76 +378,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -398,76 +378,6 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_UserEmail(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "UserEmail");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.UserEmail:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_UserEmail, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "UserEmail", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.UserEmail:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_FirstName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "FirstName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.FirstName:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_FirstName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "FirstName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.FirstName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_LastName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "LastName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.LastName:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_LastName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "LastName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.LastName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_RoleType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("defaultValue", "RoleType.STANDARD");
metaInfo.put ("name", "RoleType");
metaInfo.put ("type", "RoleType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.RoleType:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_RoleType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "RoleType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.RoleType:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_IsLogoDeleted(Map validatorMapping) private static List setupAttribMetaData_IsLogoDeleted(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -956,10 +866,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -956,10 +866,6 @@ public abstract class BaseCompany extends BaseBusinessClass
_UsedCredits = (Integer)(HELPER_UsedCredits.initialise (_UsedCredits)); _UsedCredits = (Integer)(HELPER_UsedCredits.initialise (_UsedCredits));
_HiringTeamName = (String)(HELPER_HiringTeamName.initialise (_HiringTeamName)); _HiringTeamName = (String)(HELPER_HiringTeamName.initialise (_HiringTeamName));
_ManageOwnBilling = (Boolean)(Boolean.FALSE); _ManageOwnBilling = (Boolean)(Boolean.FALSE);
_UserEmail = (String)(HELPER_UserEmail.initialise (_UserEmail));
_FirstName = (String)(HELPER_FirstName.initialise (_FirstName));
_LastName = (String)(HELPER_LastName.initialise (_LastName));
_RoleType = (RoleType)(RoleType.STANDARD);
_IsLogoDeleted = (Boolean)(Boolean.FALSE); _IsLogoDeleted = (Boolean)(Boolean.FALSE);
_CompletedProfile = (Boolean)(Boolean.FALSE); _CompletedProfile = (Boolean)(Boolean.FALSE);
_PaymentJobCount = (Integer)(HELPER_PaymentJobCount.initialise (_PaymentJobCount)); _PaymentJobCount = (Integer)(HELPER_PaymentJobCount.initialise (_PaymentJobCount));
...@@ -2965,398 +2871,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2965,398 +2871,6 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
/** /**
* Get the attribute UserEmail
*/
public String getUserEmail ()
{
assertValid();
String valToReturn = _UserEmail;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getUserEmail ((Company)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 preUserEmailChange (String newUserEmail) 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 postUserEmailChange () throws FieldException
{
}
public FieldWriteability getWriteability_UserEmail ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute UserEmail. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setUserEmail (String newUserEmail) throws FieldException
{
boolean oldAndNewIdentical = HELPER_UserEmail.compare (_UserEmail, newUserEmail);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newUserEmail = bhd.setUserEmail ((Company)this, newUserEmail);
oldAndNewIdentical = HELPER_UserEmail.compare (_UserEmail, newUserEmail);
}
if (FIELD_UserEmail_Validators.length > 0)
{
Object newUserEmailObj = HELPER_UserEmail.toObject (newUserEmail);
if (newUserEmailObj != null)
{
int loopMax = FIELD_UserEmail_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_UserEmail);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_UserEmail_Validators[v].checkAttribute (this, FIELD_UserEmail, metadata, newUserEmailObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_UserEmail () != FieldWriteability.FALSE, "Field UserEmail is not writeable");
preUserEmailChange (newUserEmail);
markFieldChange (FIELD_UserEmail);
_UserEmail = newUserEmail;
postFieldChange (FIELD_UserEmail);
postUserEmailChange ();
}
}
/**
* Get the attribute FirstName
*/
public String getFirstName ()
{
assertValid();
String valToReturn = _FirstName;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getFirstName ((Company)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 preFirstNameChange (String newFirstName) 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 postFirstNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_FirstName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute FirstName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setFirstName (String newFirstName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newFirstName = bhd.setFirstName ((Company)this, newFirstName);
oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
}
if (FIELD_FirstName_Validators.length > 0)
{
Object newFirstNameObj = HELPER_FirstName.toObject (newFirstName);
if (newFirstNameObj != null)
{
int loopMax = FIELD_FirstName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_FirstName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_FirstName_Validators[v].checkAttribute (this, FIELD_FirstName, metadata, newFirstNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_FirstName () != FieldWriteability.FALSE, "Field FirstName is not writeable");
preFirstNameChange (newFirstName);
markFieldChange (FIELD_FirstName);
_FirstName = newFirstName;
postFieldChange (FIELD_FirstName);
postFirstNameChange ();
}
}
/**
* Get the attribute LastName
*/
public String getLastName ()
{
assertValid();
String valToReturn = _LastName;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getLastName ((Company)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 preLastNameChange (String newLastName) 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 postLastNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_LastName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute LastName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setLastName (String newLastName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newLastName = bhd.setLastName ((Company)this, newLastName);
oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
}
if (FIELD_LastName_Validators.length > 0)
{
Object newLastNameObj = HELPER_LastName.toObject (newLastName);
if (newLastNameObj != null)
{
int loopMax = FIELD_LastName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_LastName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_LastName_Validators[v].checkAttribute (this, FIELD_LastName, metadata, newLastNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_LastName () != FieldWriteability.FALSE, "Field LastName is not writeable");
preLastNameChange (newLastName);
markFieldChange (FIELD_LastName);
_LastName = newLastName;
postFieldChange (FIELD_LastName);
postLastNameChange ();
}
}
/**
* Get the attribute RoleType
*/
public RoleType getRoleType ()
{
assertValid();
RoleType valToReturn = _RoleType;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getRoleType ((Company)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 preRoleTypeChange (RoleType newRoleType) 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 postRoleTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_RoleType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute RoleType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setRoleType (RoleType newRoleType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_RoleType.compare (_RoleType, newRoleType);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newRoleType = bhd.setRoleType ((Company)this, newRoleType);
oldAndNewIdentical = HELPER_RoleType.compare (_RoleType, newRoleType);
}
if (FIELD_RoleType_Validators.length > 0)
{
Object newRoleTypeObj = HELPER_RoleType.toObject (newRoleType);
if (newRoleTypeObj != null)
{
int loopMax = FIELD_RoleType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_RoleType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_RoleType_Validators[v].checkAttribute (this, FIELD_RoleType, metadata, newRoleTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_RoleType () != FieldWriteability.FALSE, "Field RoleType is not writeable");
preRoleTypeChange (newRoleType);
markFieldChange (FIELD_RoleType);
_RoleType = newRoleType;
postFieldChange (FIELD_RoleType);
postRoleTypeChange ();
}
}
/**
* Get the attribute IsLogoDeleted * Get the attribute IsLogoDeleted
*/ */
public Boolean getIsLogoDeleted () public Boolean getIsLogoDeleted ()
...@@ -5187,10 +4701,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -5187,10 +4701,6 @@ public abstract class BaseCompany extends BaseBusinessClass
_UsedCredits = sourceCompany._UsedCredits; _UsedCredits = sourceCompany._UsedCredits;
_HiringTeamName = sourceCompany._HiringTeamName; _HiringTeamName = sourceCompany._HiringTeamName;
_ManageOwnBilling = sourceCompany._ManageOwnBilling; _ManageOwnBilling = sourceCompany._ManageOwnBilling;
_UserEmail = sourceCompany._UserEmail;
_FirstName = sourceCompany._FirstName;
_LastName = sourceCompany._LastName;
_RoleType = sourceCompany._RoleType;
_IsLogoDeleted = sourceCompany._IsLogoDeleted; _IsLogoDeleted = sourceCompany._IsLogoDeleted;
_CompletedProfile = sourceCompany._CompletedProfile; _CompletedProfile = sourceCompany._CompletedProfile;
_PaymentJobCount = sourceCompany._PaymentJobCount; _PaymentJobCount = sourceCompany._PaymentJobCount;
...@@ -5277,10 +4787,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -5277,10 +4787,6 @@ public abstract class BaseCompany extends BaseBusinessClass
_UsedCredits = (Integer)(HELPER_UsedCredits.readExternal (_UsedCredits, vals.get(FIELD_UsedCredits))); // _UsedCredits = (Integer)(HELPER_UsedCredits.readExternal (_UsedCredits, vals.get(FIELD_UsedCredits))); //
_HiringTeamName = (String)(HELPER_HiringTeamName.readExternal (_HiringTeamName, vals.get(FIELD_HiringTeamName))); // _HiringTeamName = (String)(HELPER_HiringTeamName.readExternal (_HiringTeamName, vals.get(FIELD_HiringTeamName))); //
_ManageOwnBilling = (Boolean)(HELPER_ManageOwnBilling.readExternal (_ManageOwnBilling, vals.get(FIELD_ManageOwnBilling))); // _ManageOwnBilling = (Boolean)(HELPER_ManageOwnBilling.readExternal (_ManageOwnBilling, vals.get(FIELD_ManageOwnBilling))); //
_UserEmail = (String)(HELPER_UserEmail.readExternal (_UserEmail, vals.get(FIELD_UserEmail))); //
_FirstName = (String)(HELPER_FirstName.readExternal (_FirstName, vals.get(FIELD_FirstName))); //
_LastName = (String)(HELPER_LastName.readExternal (_LastName, vals.get(FIELD_LastName))); //
_RoleType = (RoleType)(HELPER_RoleType.readExternal (_RoleType, vals.get(FIELD_RoleType))); //
_IsLogoDeleted = (Boolean)(HELPER_IsLogoDeleted.readExternal (_IsLogoDeleted, vals.get(FIELD_IsLogoDeleted))); // _IsLogoDeleted = (Boolean)(HELPER_IsLogoDeleted.readExternal (_IsLogoDeleted, vals.get(FIELD_IsLogoDeleted))); //
_CompletedProfile = (Boolean)(HELPER_CompletedProfile.readExternal (_CompletedProfile, vals.get(FIELD_CompletedProfile))); // _CompletedProfile = (Boolean)(HELPER_CompletedProfile.readExternal (_CompletedProfile, vals.get(FIELD_CompletedProfile))); //
_PaymentJobCount = (Integer)(HELPER_PaymentJobCount.readExternal (_PaymentJobCount, vals.get(FIELD_PaymentJobCount))); // _PaymentJobCount = (Integer)(HELPER_PaymentJobCount.readExternal (_PaymentJobCount, vals.get(FIELD_PaymentJobCount))); //
...@@ -5324,10 +4830,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -5324,10 +4830,6 @@ public abstract class BaseCompany extends BaseBusinessClass
vals.put (FIELD_UsedCredits, HELPER_UsedCredits.writeExternal (_UsedCredits)); vals.put (FIELD_UsedCredits, HELPER_UsedCredits.writeExternal (_UsedCredits));
vals.put (FIELD_HiringTeamName, HELPER_HiringTeamName.writeExternal (_HiringTeamName)); vals.put (FIELD_HiringTeamName, HELPER_HiringTeamName.writeExternal (_HiringTeamName));
vals.put (FIELD_ManageOwnBilling, HELPER_ManageOwnBilling.writeExternal (_ManageOwnBilling)); vals.put (FIELD_ManageOwnBilling, HELPER_ManageOwnBilling.writeExternal (_ManageOwnBilling));
vals.put (FIELD_UserEmail, HELPER_UserEmail.writeExternal (_UserEmail));
vals.put (FIELD_FirstName, HELPER_FirstName.writeExternal (_FirstName));
vals.put (FIELD_LastName, HELPER_LastName.writeExternal (_LastName));
vals.put (FIELD_RoleType, HELPER_RoleType.writeExternal (_RoleType));
vals.put (FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.writeExternal (_IsLogoDeleted)); vals.put (FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.writeExternal (_IsLogoDeleted));
vals.put (FIELD_CompletedProfile, HELPER_CompletedProfile.writeExternal (_CompletedProfile)); vals.put (FIELD_CompletedProfile, HELPER_CompletedProfile.writeExternal (_CompletedProfile));
vals.put (FIELD_PaymentJobCount, HELPER_PaymentJobCount.writeExternal (_PaymentJobCount)); vals.put (FIELD_PaymentJobCount, HELPER_PaymentJobCount.writeExternal (_PaymentJobCount));
...@@ -5448,10 +4950,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -5448,10 +4950,6 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor.visitField(this, FIELD_HiringTeamName, HELPER_HiringTeamName.toObject(getHiringTeamName())); visitor.visitField(this, FIELD_HiringTeamName, HELPER_HiringTeamName.toObject(getHiringTeamName()));
visitor.visitField(this, FIELD_ManageOwnBilling, HELPER_ManageOwnBilling.toObject(getManageOwnBilling())); visitor.visitField(this, FIELD_ManageOwnBilling, HELPER_ManageOwnBilling.toObject(getManageOwnBilling()));
visitor.visitField(this, FIELD_UserEmail, HELPER_UserEmail.toObject(getUserEmail()));
visitor.visitField(this, FIELD_FirstName, HELPER_FirstName.toObject(getFirstName()));
visitor.visitField(this, FIELD_LastName, HELPER_LastName.toObject(getLastName()));
visitor.visitField(this, FIELD_RoleType, HELPER_RoleType.toObject(getRoleType()));
visitor.visitField(this, FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.toObject(getIsLogoDeleted())); visitor.visitField(this, FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.toObject(getIsLogoDeleted()));
visitor.visitField(this, FIELD_CompletedProfile, HELPER_CompletedProfile.toObject(getCompletedProfile())); visitor.visitField(this, FIELD_CompletedProfile, HELPER_CompletedProfile.toObject(getCompletedProfile()));
visitor.visitField(this, FIELD_PaymentJobCount, HELPER_PaymentJobCount.toObject(getPaymentJobCount())); visitor.visitField(this, FIELD_PaymentJobCount, HELPER_PaymentJobCount.toObject(getPaymentJobCount()));
...@@ -5897,22 +5395,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -5897,22 +5395,6 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return HELPER_ManageOwnBilling.toObject (getManageOwnBilling ()); return HELPER_ManageOwnBilling.toObject (getManageOwnBilling ());
} }
else if (attribName.equals (FIELD_UserEmail))
{
return HELPER_UserEmail.toObject (getUserEmail ());
}
else if (attribName.equals (FIELD_FirstName))
{
return HELPER_FirstName.toObject (getFirstName ());
}
else if (attribName.equals (FIELD_LastName))
{
return HELPER_LastName.toObject (getLastName ());
}
else if (attribName.equals (FIELD_RoleType))
{
return HELPER_RoleType.toObject (getRoleType ());
}
else if (attribName.equals (FIELD_IsLogoDeleted)) else if (attribName.equals (FIELD_IsLogoDeleted))
{ {
return HELPER_IsLogoDeleted.toObject (getIsLogoDeleted ()); return HELPER_IsLogoDeleted.toObject (getIsLogoDeleted ());
...@@ -6026,22 +5508,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6026,22 +5508,6 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return HELPER_ManageOwnBilling; return HELPER_ManageOwnBilling;
} }
else if (attribName.equals (FIELD_UserEmail))
{
return HELPER_UserEmail;
}
else if (attribName.equals (FIELD_FirstName))
{
return HELPER_FirstName;
}
else if (attribName.equals (FIELD_LastName))
{
return HELPER_LastName;
}
else if (attribName.equals (FIELD_RoleType))
{
return HELPER_RoleType;
}
else if (attribName.equals (FIELD_IsLogoDeleted)) else if (attribName.equals (FIELD_IsLogoDeleted))
{ {
return HELPER_IsLogoDeleted; return HELPER_IsLogoDeleted;
...@@ -6155,22 +5621,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6155,22 +5621,6 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
setManageOwnBilling ((Boolean)(HELPER_ManageOwnBilling.fromObject (_ManageOwnBilling, attribValue))); setManageOwnBilling ((Boolean)(HELPER_ManageOwnBilling.fromObject (_ManageOwnBilling, attribValue)));
} }
else if (attribName.equals (FIELD_UserEmail))
{
setUserEmail ((String)(HELPER_UserEmail.fromObject (_UserEmail, attribValue)));
}
else if (attribName.equals (FIELD_FirstName))
{
setFirstName ((String)(HELPER_FirstName.fromObject (_FirstName, attribValue)));
}
else if (attribName.equals (FIELD_LastName))
{
setLastName ((String)(HELPER_LastName.fromObject (_LastName, attribValue)));
}
else if (attribName.equals (FIELD_RoleType))
{
setRoleType ((RoleType)(HELPER_RoleType.fromObject (_RoleType, attribValue)));
}
else if (attribName.equals (FIELD_IsLogoDeleted)) else if (attribName.equals (FIELD_IsLogoDeleted))
{ {
setIsLogoDeleted ((Boolean)(HELPER_IsLogoDeleted.fromObject (_IsLogoDeleted, attribValue))); setIsLogoDeleted ((Boolean)(HELPER_IsLogoDeleted.fromObject (_IsLogoDeleted, attribValue)));
...@@ -6311,22 +5761,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6311,22 +5761,6 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return getWriteability_ManageOwnBilling (); return getWriteability_ManageOwnBilling ();
} }
else if (fieldName.equals (FIELD_UserEmail))
{
return getWriteability_UserEmail ();
}
else if (fieldName.equals (FIELD_FirstName))
{
return getWriteability_FirstName ();
}
else if (fieldName.equals (FIELD_LastName))
{
return getWriteability_LastName ();
}
else if (fieldName.equals (FIELD_RoleType))
{
return getWriteability_RoleType ();
}
else if (fieldName.equals (FIELD_IsLogoDeleted)) else if (fieldName.equals (FIELD_IsLogoDeleted))
{ {
return getWriteability_IsLogoDeleted (); return getWriteability_IsLogoDeleted ();
...@@ -6465,26 +5899,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6465,26 +5899,6 @@ public abstract class BaseCompany extends BaseBusinessClass
fields.add (FIELD_ManageOwnBilling); fields.add (FIELD_ManageOwnBilling);
} }
if (getWriteability_UserEmail () != FieldWriteability.TRUE)
{
fields.add (FIELD_UserEmail);
}
if (getWriteability_FirstName () != FieldWriteability.TRUE)
{
fields.add (FIELD_FirstName);
}
if (getWriteability_LastName () != FieldWriteability.TRUE)
{
fields.add (FIELD_LastName);
}
if (getWriteability_RoleType () != FieldWriteability.TRUE)
{
fields.add (FIELD_RoleType);
}
if (getWriteability_IsLogoDeleted () != FieldWriteability.TRUE) if (getWriteability_IsLogoDeleted () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_IsLogoDeleted); fields.add (FIELD_IsLogoDeleted);
...@@ -6539,10 +5953,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6539,10 +5953,6 @@ public abstract class BaseCompany extends BaseBusinessClass
result.add(HELPER_UsedCredits.getAttribObject (getClass (), _UsedCredits, false, FIELD_UsedCredits)); result.add(HELPER_UsedCredits.getAttribObject (getClass (), _UsedCredits, false, FIELD_UsedCredits));
result.add(HELPER_HiringTeamName.getAttribObject (getClass (), _HiringTeamName, false, FIELD_HiringTeamName)); result.add(HELPER_HiringTeamName.getAttribObject (getClass (), _HiringTeamName, false, FIELD_HiringTeamName));
result.add(HELPER_ManageOwnBilling.getAttribObject (getClass (), _ManageOwnBilling, false, FIELD_ManageOwnBilling)); result.add(HELPER_ManageOwnBilling.getAttribObject (getClass (), _ManageOwnBilling, false, FIELD_ManageOwnBilling));
result.add(HELPER_UserEmail.getAttribObject (getClass (), _UserEmail, false, FIELD_UserEmail));
result.add(HELPER_FirstName.getAttribObject (getClass (), _FirstName, false, FIELD_FirstName));
result.add(HELPER_LastName.getAttribObject (getClass (), _LastName, false, FIELD_LastName));
result.add(HELPER_RoleType.getAttribObject (getClass (), _RoleType, false, FIELD_RoleType));
result.add(HELPER_IsLogoDeleted.getAttribObject (getClass (), _IsLogoDeleted, false, FIELD_IsLogoDeleted)); result.add(HELPER_IsLogoDeleted.getAttribObject (getClass (), _IsLogoDeleted, false, FIELD_IsLogoDeleted));
result.add(HELPER_CompletedProfile.getAttribObject (getClass (), _CompletedProfile, false, FIELD_CompletedProfile)); result.add(HELPER_CompletedProfile.getAttribObject (getClass (), _CompletedProfile, false, FIELD_CompletedProfile));
result.add(HELPER_PaymentJobCount.getAttribObject (getClass (), _PaymentJobCount, false, FIELD_PaymentJobCount)); result.add(HELPER_PaymentJobCount.getAttribObject (getClass (), _PaymentJobCount, false, FIELD_PaymentJobCount));
...@@ -6977,78 +6387,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -6977,78 +6387,6 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
/** /**
* Get the attribute UserEmail
*/
public String getUserEmail (Company obj, String original)
{
return original;
}
/**
* Change the value set for attribute UserEmail.
* May modify the field beforehand
* Occurs before validation.
*/
public String setUserEmail (Company obj, String newUserEmail) throws FieldException
{
return newUserEmail;
}
/**
* Get the attribute FirstName
*/
public String getFirstName (Company obj, String original)
{
return original;
}
/**
* Change the value set for attribute FirstName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setFirstName (Company obj, String newFirstName) throws FieldException
{
return newFirstName;
}
/**
* Get the attribute LastName
*/
public String getLastName (Company obj, String original)
{
return original;
}
/**
* Change the value set for attribute LastName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setLastName (Company obj, String newLastName) throws FieldException
{
return newLastName;
}
/**
* Get the attribute RoleType
*/
public RoleType getRoleType (Company obj, RoleType original)
{
return original;
}
/**
* Change the value set for attribute RoleType.
* May modify the field beforehand
* Occurs before validation.
*/
public RoleType setRoleType (Company obj, RoleType newRoleType) throws FieldException
{
return newRoleType;
}
/**
* Get the attribute IsLogoDeleted * Get the attribute IsLogoDeleted
*/ */
public Boolean getIsLogoDeleted (Company obj, Boolean original) public Boolean getIsLogoDeleted (Company obj, Boolean original)
...@@ -7210,22 +6548,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -7210,22 +6548,6 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return toManageOwnBilling (); return toManageOwnBilling ();
} }
if (name.equals ("UserEmail"))
{
return toUserEmail ();
}
if (name.equals ("FirstName"))
{
return toFirstName ();
}
if (name.equals ("LastName"))
{
return toLastName ();
}
if (name.equals ("RoleType"))
{
return toRoleType ();
}
if (name.equals ("IsLogoDeleted")) if (name.equals ("IsLogoDeleted"))
{ {
return toIsLogoDeleted (); return toIsLogoDeleted ();
...@@ -7344,14 +6666,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -7344,14 +6666,6 @@ public abstract class BaseCompany extends BaseBusinessClass
public PipeLine<From, Boolean> toManageOwnBilling () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ManageOwnBilling)); } public PipeLine<From, Boolean> toManageOwnBilling () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ManageOwnBilling)); }
public PipeLine<From, String> toUserEmail () { return pipe(new ORMAttributePipe<Me, String>(FIELD_UserEmail)); }
public PipeLine<From, String> toFirstName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_FirstName)); }
public PipeLine<From, String> toLastName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_LastName)); }
public PipeLine<From, RoleType> toRoleType () { return pipe(new ORMAttributePipe<Me, RoleType>(FIELD_RoleType)); }
public PipeLine<From, Boolean> toIsLogoDeleted () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsLogoDeleted)); } public PipeLine<From, Boolean> toIsLogoDeleted () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsLogoDeleted)); }
public PipeLine<From, Boolean> toCompletedProfile () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_CompletedProfile)); } public PipeLine<From, Boolean> toCompletedProfile () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_CompletedProfile)); }
...@@ -7455,26 +6769,6 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -7455,26 +6769,6 @@ public abstract class BaseCompany extends BaseBusinessClass
return true; return true;
} }
if(CollectionUtils.equals(attribName, "UserEmail"))
{
return true;
}
if(CollectionUtils.equals(attribName, "FirstName"))
{
return true;
}
if(CollectionUtils.equals(attribName, "LastName"))
{
return true;
}
if(CollectionUtils.equals(attribName, "RoleType"))
{
return true;
}
if(CollectionUtils.equals(attribName, "IsLogoDeleted")) if(CollectionUtils.equals(attribName, "IsLogoDeleted"))
{ {
return true; return true;
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
public abstract class BaseHiringTeamLinkNPO extends NonPersistentBO
{
// Reference instance for the object
public static final HiringTeamLinkNPO REFERENCE_HiringTeamLinkNPO = new HiringTeamLinkNPO ();
// Reference instance for the object
public static final HiringTeamLinkNPO DUMMY_HiringTeamLinkNPO = new DummyHiringTeamLinkNPO ();
// Static constants corresponding to field names
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String SINGLEREFERENCE_InviteTeammate = "InviteTeammate";
public static final String BACKREF_InviteTeammate = "";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
// Private attributes corresponding to business object data
// Private attributes corresponding to single references
private SingleAssociation<HiringTeamLinkNPO, HiringTeam> _HiringTeam;
private SingleAssociation<HiringTeamLinkNPO, InviteTeammateNPO> _InviteTeammate;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_HiringTeamLinkNPO = new HashMap ();
// Arrays of validators for each attribute
// Arrays of behaviour decorators
private static final HiringTeamLinkNPOBehaviourDecorator[] HiringTeamLinkNPO_BehaviourDecorators;
static
{
try
{
String tmp_InviteTeammate = InviteTeammateNPO.BACKREF_HiringTeams;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_HiringTeam();
setupAssocMetaData_InviteTeammate();
REFERENCE_HiringTeamLinkNPO.initialiseReference ();
DUMMY_HiringTeamLinkNPO.initialiseReference ();
HiringTeamLinkNPO_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(HiringTeamLinkNPO.class).toArray(new HiringTeamLinkNPOBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_HiringTeam()
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "HiringTeam");
metaInfo.put ("type", "HiringTeam");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for HiringTeamLinkNPO.HiringTeam:", metaInfo);
ATTRIBUTES_METADATA_HiringTeamLinkNPO.put (SINGLEREFERENCE_HiringTeam, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_InviteTeammate()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "HiringTeams");
metaInfo.put ("name", "InviteTeammate");
metaInfo.put ("type", "InviteTeammateNPO");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for HiringTeamLinkNPO.InviteTeammate:", metaInfo);
ATTRIBUTES_METADATA_HiringTeamLinkNPO.put (SINGLEREFERENCE_InviteTeammate, Collections.unmodifiableMap (metaInfo));
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseHiringTeamLinkNPO ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return HiringTeamLinkNPO_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_HiringTeam = new SingleAssociation<HiringTeamLinkNPO, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "it_does_not_matter");
_InviteTeammate = new SingleAssociation<HiringTeamLinkNPO, InviteTeammateNPO> (this, SINGLEREFERENCE_InviteTeammate, InviteTeammateNPO.MULTIPLEREFERENCE_HiringTeams, InviteTeammateNPO.REFERENCE_InviteTeammateNPO, "it_does_not_matter");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_HiringTeam = new SingleAssociation<HiringTeamLinkNPO, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "it_does_not_matter");
_InviteTeammate = new SingleAssociation<HiringTeamLinkNPO, InviteTeammateNPO> (this, SINGLEREFERENCE_InviteTeammate, InviteTeammateNPO.MULTIPLEREFERENCE_HiringTeams, InviteTeammateNPO.REFERENCE_InviteTeammateNPO, "it_does_not_matter");
return this;
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("HiringTeam");
result.add("InviteTeammate");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
return _HiringTeam.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
return _InviteTeammate.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
return null ;
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
return InviteTeammateNPO.MULTIPLEREFERENCE_HiringTeams ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
return getHiringTeam ();
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
return getInviteTeammate ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
return getHiringTeam (getType);
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
return getInviteTeammate (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
return getHiringTeamID ();
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
return getInviteTeammateID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_HiringTeam))
{
setHiringTeam ((HiringTeam)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_InviteTeammate))
{
setInviteTeammate ((InviteTeammateNPO)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference HiringTeam
*/
public HiringTeam getHiringTeam () throws StorageException
{
assertValid();
try
{
return (HiringTeam)(_HiringTeam.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in HiringTeamLinkNPO:", this.getObjectID (), ", was trying to get HiringTeam:", getHiringTeamID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _HiringTeam.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public HiringTeam getHiringTeam (Get getType) throws StorageException
{
assertValid();
return _HiringTeam.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getHiringTeamID ()
{
assertValid();
if (_HiringTeam == null)
{
return null;
}
else
{
return _HiringTeam.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 preHiringTeamChange (HiringTeam newHiringTeam) 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 postHiringTeamChange () throws FieldException
{
}
public FieldWriteability getWriteability_HiringTeam ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference HiringTeam. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setHiringTeam (HiringTeam newHiringTeam) throws StorageException, FieldException
{
if (_HiringTeam.wouldReferencedChange (newHiringTeam))
{
assertValid();
Debug.assertion (getWriteability_HiringTeam () != FieldWriteability.FALSE, "Assoc HiringTeam is not writeable");
preHiringTeamChange (newHiringTeam);
_HiringTeam.set (newHiringTeam);
postHiringTeamChange ();
}
}
/**
* Get the reference InviteTeammate
*/
public InviteTeammateNPO getInviteTeammate () throws StorageException
{
assertValid();
try
{
return (InviteTeammateNPO)(_InviteTeammate.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in HiringTeamLinkNPO:", this.getObjectID (), ", was trying to get InviteTeammateNPO:", getInviteTeammateID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _InviteTeammate.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public InviteTeammateNPO getInviteTeammate (Get getType) throws StorageException
{
assertValid();
return _InviteTeammate.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getInviteTeammateID ()
{
assertValid();
if (_InviteTeammate == null)
{
return null;
}
else
{
return _InviteTeammate.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 preInviteTeammateChange (InviteTeammateNPO newInviteTeammate) 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 postInviteTeammateChange () throws FieldException
{
}
public FieldWriteability getWriteability_InviteTeammate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference InviteTeammate. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setInviteTeammate (InviteTeammateNPO newInviteTeammate) throws StorageException, FieldException
{
if (_InviteTeammate.wouldReferencedChange (newInviteTeammate))
{
assertValid();
Debug.assertion (getWriteability_InviteTeammate () != FieldWriteability.FALSE, "Assoc InviteTeammate is not writeable");
preInviteTeammateChange (newInviteTeammate);
InviteTeammateNPO oldInviteTeammate = getInviteTeammate ();
if (oldInviteTeammate != null)
{
// This is to stop validation from triggering when we are removed
_InviteTeammate.set (null);
oldInviteTeammate.removeFromHiringTeams ((HiringTeamLinkNPO)(this));
}
_InviteTeammate.set (newInviteTeammate);
if (newInviteTeammate != null)
{
newInviteTeammate.addToHiringTeams ((HiringTeamLinkNPO)(this));
}
postInviteTeammateChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_InviteTeammate.isLoaded () || getTransaction ().isObjectLoaded (_InviteTeammate.getReferencedType (), getInviteTeammateID ()))
{
InviteTeammateNPO referenced = getInviteTeammate ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null HiringTeams from ", getObjectID (), " to ", referenced.getObjectID ());
_InviteTeammate.set (null);
referenced.removeFromHiringTeams ((HiringTeamLinkNPO)this);
}
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public HiringTeamLinkNPO newInstance ()
{
return new HiringTeamLinkNPO ();
}
public HiringTeamLinkNPO referenceInstance ()
{
return REFERENCE_HiringTeamLinkNPO;
}
public HiringTeamLinkNPO getInTransaction (ObjectTransaction t) throws StorageException
{
return getHiringTeamLinkNPOByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_HiringTeamLinkNPO;
}
public String getBaseSetName ()
{
return "it_does_not_matter";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (myID, "it_does_not_matter", myPSetStatus);
it_does_not_matterPSet.setAttrib (FIELD_ObjectID, myID);
_HiringTeam.getPersistentSets (allSets);
_InviteTeammate.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (objectID, "it_does_not_matter");
_HiringTeam.setFromPersistentSets (objectID, allSets);
_InviteTeammate.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof HiringTeamLinkNPO)
{
HiringTeamLinkNPO otherHiringTeamLinkNPO = (HiringTeamLinkNPO)other;
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseHiringTeamLinkNPO)
{
BaseHiringTeamLinkNPO sourceHiringTeamLinkNPO = (BaseHiringTeamLinkNPO)(source);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseHiringTeamLinkNPO)
{
BaseHiringTeamLinkNPO sourceHiringTeamLinkNPO = (BaseHiringTeamLinkNPO)(source);
_HiringTeam.copyFrom (sourceHiringTeamLinkNPO._HiringTeam, linkToGhosts);
_InviteTeammate.copyFrom (sourceHiringTeamLinkNPO._InviteTeammate, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseHiringTeamLinkNPO)
{
BaseHiringTeamLinkNPO sourceHiringTeamLinkNPO = (BaseHiringTeamLinkNPO)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
_InviteTeammate.readExternalData(vals.get(SINGLEREFERENCE_InviteTeammate));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
vals.put (SINGLEREFERENCE_InviteTeammate, _InviteTeammate.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseHiringTeamLinkNPO)
{
BaseHiringTeamLinkNPO otherHiringTeamLinkNPO = (BaseHiringTeamLinkNPO)(other);
// Compare single assocs
_HiringTeam.compare (otherHiringTeamLinkNPO._HiringTeam, listener);
_InviteTeammate.compare (otherHiringTeamLinkNPO._InviteTeammate, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitAssociation (_HiringTeam);
visitor.visitAssociation (_InviteTeammate);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_HiringTeam))
{
visitor.visit (_HiringTeam);
}
if (scope.includes (_InviteTeammate))
{
visitor.visit (_InviteTeammate);
}
}
public static HiringTeamLinkNPO createHiringTeamLinkNPO (ObjectTransaction transaction) throws StorageException
{
HiringTeamLinkNPO result = new HiringTeamLinkNPO ();
result.initialiseNewObject (transaction);
return result;
}
public static HiringTeamLinkNPO getHiringTeamLinkNPOByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (HiringTeamLinkNPO)(transaction.getObjectByID (REFERENCE_HiringTeamLinkNPO, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (SINGLEREFERENCE_HiringTeam))
{
return filter.matches (getHiringTeam ());
}
else if (attribName.equals (SINGLEREFERENCE_InviteTeammate))
{
return filter.matches (getInviteTeammate ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (SINGLEREFERENCE_HiringTeam))
{
return getWriteability_HiringTeam ();
}
else if (fieldName.equals (SINGLEREFERENCE_InviteTeammate))
{
return getWriteability_InviteTeammate ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_HiringTeamLinkNPO.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_HiringTeamLinkNPO.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_HiringTeamLinkNPO.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_HiringTeamLinkNPO.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class HiringTeamLinkNPOBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<HiringTeamLinkNPO>
{
}
public ORMPipeLine pipes()
{
return new HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> ((HiringTeamLinkNPO)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> pipelineHiringTeamLinkNPO()
{
return (HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO>) pipes();
}
public static HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> pipesHiringTeamLinkNPO(Collection<HiringTeamLinkNPO> items)
{
return REFERENCE_HiringTeamLinkNPO.new HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> (items);
}
public static HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> pipesHiringTeamLinkNPO(HiringTeamLinkNPO[] _items)
{
return pipesHiringTeamLinkNPO(Arrays.asList (_items));
}
public static HiringTeamLinkNPOPipeLineFactory<HiringTeamLinkNPO, HiringTeamLinkNPO> pipesHiringTeamLinkNPO()
{
return pipesHiringTeamLinkNPO((Collection)null);
}
public class HiringTeamLinkNPOPipeLineFactory<From extends BaseBusinessClass, Me extends HiringTeamLinkNPO> extends NonPersistentBOPipeLineFactory<From, Me>
{
public <Prev> HiringTeamLinkNPOPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public HiringTeamLinkNPOPipeLineFactory (From seed)
{
super(seed);
}
public HiringTeamLinkNPOPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("HiringTeam"))
{
return toHiringTeam ();
}
if (name.equals ("InviteTeammate"))
{
return toInviteTeammate ();
}
return super.to(name);
}
public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam () { return toHiringTeam (Filter.ALL); }
public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam (Filter<HiringTeam> filter)
{
return HiringTeam.REFERENCE_HiringTeam.new HiringTeamPipeLineFactory<From, HiringTeam> (this, new ORMSingleAssocPipe<Me, HiringTeam>(SINGLEREFERENCE_HiringTeam, filter));
}
public InviteTeammateNPO.InviteTeammateNPOPipeLineFactory<From, InviteTeammateNPO> toInviteTeammate () { return toInviteTeammate (Filter.ALL); }
public InviteTeammateNPO.InviteTeammateNPOPipeLineFactory<From, InviteTeammateNPO> toInviteTeammate (Filter<InviteTeammateNPO> filter)
{
return InviteTeammateNPO.REFERENCE_InviteTeammateNPO.new InviteTeammateNPOPipeLineFactory<From, InviteTeammateNPO> (this, new ORMSingleAssocPipe<Me, InviteTeammateNPO>(SINGLEREFERENCE_InviteTeammate, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyHiringTeamLinkNPO extends HiringTeamLinkNPO
{
// Default constructor primarily to support Externalisable
public DummyHiringTeamLinkNPO()
{
super();
}
public void assertValid ()
{
}
public HiringTeam getHiringTeam () throws StorageException
{
return (HiringTeam)(HiringTeam.DUMMY_HiringTeam);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getHiringTeamID ()
{
return HiringTeam.DUMMY_HiringTeam.getObjectID();
}
public InviteTeammateNPO getInviteTeammate () throws StorageException
{
return (InviteTeammateNPO)(InviteTeammateNPO.DUMMY_InviteTeammateNPO);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getInviteTeammateID ()
{
return InviteTeammateNPO.DUMMY_InviteTeammateNPO.getObjectID();
}
}
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
import performa.orm.types.*;
public abstract class BaseInviteTeammateNPO extends NonPersistentBO
{
// Reference instance for the object
public static final InviteTeammateNPO REFERENCE_InviteTeammateNPO = new InviteTeammateNPO ();
// Reference instance for the object
public static final InviteTeammateNPO DUMMY_InviteTeammateNPO = new DummyInviteTeammateNPO ();
// Static constants corresponding to field names
public static final String FIELD_UserEmail = "UserEmail";
public static final String FIELD_FirstName = "FirstName";
public static final String FIELD_LastName = "LastName";
public static final String FIELD_RoleType = "RoleType";
public static final String MULTIPLEREFERENCE_HiringTeams = "HiringTeams";
public static final String BACKREF_HiringTeams = "";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<InviteTeammateNPO> HELPER_UserEmail = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<InviteTeammateNPO> HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<InviteTeammateNPO> HELPER_LastName = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<InviteTeammateNPO, RoleType> HELPER_RoleType = new EnumeratedAttributeHelper<InviteTeammateNPO, RoleType> (RoleType.FACTORY_RoleType);
// Private attributes corresponding to business object data
private String _UserEmail;
private String _FirstName;
private String _LastName;
private RoleType _RoleType;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
private MultipleAssociation<InviteTeammateNPO, HiringTeamLinkNPO> _HiringTeams;
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_InviteTeammateNPO = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_UserEmail_Validators;
private static final AttributeValidator[] FIELD_FirstName_Validators;
private static final AttributeValidator[] FIELD_LastName_Validators;
private static final AttributeValidator[] FIELD_RoleType_Validators;
// Arrays of behaviour decorators
private static final InviteTeammateNPOBehaviourDecorator[] InviteTeammateNPO_BehaviourDecorators;
static
{
try
{
String tmp_HiringTeams = HiringTeamLinkNPO.BACKREF_InviteTeammate;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_HiringTeams();
FIELD_UserEmail_Validators = (AttributeValidator[])setupAttribMetaData_UserEmail(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_FirstName_Validators = (AttributeValidator[])setupAttribMetaData_FirstName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_LastName_Validators = (AttributeValidator[])setupAttribMetaData_LastName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RoleType_Validators = (AttributeValidator[])setupAttribMetaData_RoleType(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_InviteTeammateNPO.initialiseReference ();
DUMMY_InviteTeammateNPO.initialiseReference ();
InviteTeammateNPO_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(InviteTeammateNPO.class).toArray(new InviteTeammateNPOBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_HiringTeams()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "InviteTeammate");
metaInfo.put ("name", "HiringTeams");
metaInfo.put ("type", "HiringTeamLinkNPO");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for InviteTeammateNPO.HiringTeams:", metaInfo);
ATTRIBUTES_METADATA_InviteTeammateNPO.put (MULTIPLEREFERENCE_HiringTeams, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_UserEmail(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "UserEmail");
metaInfo.put ("type", "String");
metaInfo.put ("validators", "Email");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for InviteTeammateNPO.UserEmail:", metaInfo);
ATTRIBUTES_METADATA_InviteTeammateNPO.put (FIELD_UserEmail, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(InviteTeammateNPO.class, "UserEmail", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for InviteTeammateNPO.UserEmail:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_FirstName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "FirstName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for InviteTeammateNPO.FirstName:", metaInfo);
ATTRIBUTES_METADATA_InviteTeammateNPO.put (FIELD_FirstName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(InviteTeammateNPO.class, "FirstName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for InviteTeammateNPO.FirstName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_LastName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "LastName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for InviteTeammateNPO.LastName:", metaInfo);
ATTRIBUTES_METADATA_InviteTeammateNPO.put (FIELD_LastName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(InviteTeammateNPO.class, "LastName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for InviteTeammateNPO.LastName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_RoleType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("name", "RoleType");
metaInfo.put ("type", "RoleType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for InviteTeammateNPO.RoleType:", metaInfo);
ATTRIBUTES_METADATA_InviteTeammateNPO.put (FIELD_RoleType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(InviteTeammateNPO.class, "RoleType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for InviteTeammateNPO.RoleType:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseInviteTeammateNPO ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return InviteTeammateNPO_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_UserEmail = (String)(HELPER_UserEmail.initialise (_UserEmail));
_FirstName = (String)(HELPER_FirstName.initialise (_FirstName));
_LastName = (String)(HELPER_LastName.initialise (_LastName));
_RoleType = (RoleType)(HELPER_RoleType.initialise (_RoleType));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_HiringTeams = new MultipleAssociation<InviteTeammateNPO, HiringTeamLinkNPO> (this, MULTIPLEREFERENCE_HiringTeams, HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate, HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO);
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_HiringTeams = new MultipleAssociation<InviteTeammateNPO, HiringTeamLinkNPO> (this, MULTIPLEREFERENCE_HiringTeams, HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate, HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO);
return this;
}
/**
* Get the attribute UserEmail
*/
public String getUserEmail ()
{
assertValid();
String valToReturn = _UserEmail;
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
valToReturn = bhd.getUserEmail ((InviteTeammateNPO)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 preUserEmailChange (String newUserEmail) 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 postUserEmailChange () throws FieldException
{
}
public FieldWriteability getWriteability_UserEmail ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute UserEmail. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setUserEmail (String newUserEmail) throws FieldException
{
boolean oldAndNewIdentical = HELPER_UserEmail.compare (_UserEmail, newUserEmail);
try
{
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
newUserEmail = bhd.setUserEmail ((InviteTeammateNPO)this, newUserEmail);
oldAndNewIdentical = HELPER_UserEmail.compare (_UserEmail, newUserEmail);
}
if (FIELD_UserEmail_Validators.length > 0)
{
Object newUserEmailObj = HELPER_UserEmail.toObject (newUserEmail);
if (newUserEmailObj != null)
{
int loopMax = FIELD_UserEmail_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (FIELD_UserEmail);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_UserEmail_Validators[v].checkAttribute (this, FIELD_UserEmail, metadata, newUserEmailObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_UserEmail () != FieldWriteability.FALSE, "Field UserEmail is not writeable");
preUserEmailChange (newUserEmail);
markFieldChange (FIELD_UserEmail);
_UserEmail = newUserEmail;
postFieldChange (FIELD_UserEmail);
postUserEmailChange ();
}
}
/**
* Get the attribute FirstName
*/
public String getFirstName ()
{
assertValid();
String valToReturn = _FirstName;
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
valToReturn = bhd.getFirstName ((InviteTeammateNPO)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 preFirstNameChange (String newFirstName) 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 postFirstNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_FirstName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute FirstName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setFirstName (String newFirstName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
try
{
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
newFirstName = bhd.setFirstName ((InviteTeammateNPO)this, newFirstName);
oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
}
if (FIELD_FirstName_Validators.length > 0)
{
Object newFirstNameObj = HELPER_FirstName.toObject (newFirstName);
if (newFirstNameObj != null)
{
int loopMax = FIELD_FirstName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (FIELD_FirstName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_FirstName_Validators[v].checkAttribute (this, FIELD_FirstName, metadata, newFirstNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_FirstName () != FieldWriteability.FALSE, "Field FirstName is not writeable");
preFirstNameChange (newFirstName);
markFieldChange (FIELD_FirstName);
_FirstName = newFirstName;
postFieldChange (FIELD_FirstName);
postFirstNameChange ();
}
}
/**
* Get the attribute LastName
*/
public String getLastName ()
{
assertValid();
String valToReturn = _LastName;
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
valToReturn = bhd.getLastName ((InviteTeammateNPO)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 preLastNameChange (String newLastName) 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 postLastNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_LastName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute LastName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setLastName (String newLastName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
try
{
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
newLastName = bhd.setLastName ((InviteTeammateNPO)this, newLastName);
oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
}
if (FIELD_LastName_Validators.length > 0)
{
Object newLastNameObj = HELPER_LastName.toObject (newLastName);
if (newLastNameObj != null)
{
int loopMax = FIELD_LastName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (FIELD_LastName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_LastName_Validators[v].checkAttribute (this, FIELD_LastName, metadata, newLastNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_LastName () != FieldWriteability.FALSE, "Field LastName is not writeable");
preLastNameChange (newLastName);
markFieldChange (FIELD_LastName);
_LastName = newLastName;
postFieldChange (FIELD_LastName);
postLastNameChange ();
}
}
/**
* Get the attribute RoleType
*/
public RoleType getRoleType ()
{
assertValid();
RoleType valToReturn = _RoleType;
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
valToReturn = bhd.getRoleType ((InviteTeammateNPO)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 preRoleTypeChange (RoleType newRoleType) 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 postRoleTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_RoleType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute RoleType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setRoleType (RoleType newRoleType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_RoleType.compare (_RoleType, newRoleType);
try
{
for (InviteTeammateNPOBehaviourDecorator bhd : InviteTeammateNPO_BehaviourDecorators)
{
newRoleType = bhd.setRoleType ((InviteTeammateNPO)this, newRoleType);
oldAndNewIdentical = HELPER_RoleType.compare (_RoleType, newRoleType);
}
if (FIELD_RoleType_Validators.length > 0)
{
Object newRoleTypeObj = HELPER_RoleType.toObject (newRoleType);
if (newRoleTypeObj != null)
{
int loopMax = FIELD_RoleType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (FIELD_RoleType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_RoleType_Validators[v].checkAttribute (this, FIELD_RoleType, metadata, newRoleTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_RoleType () != FieldWriteability.FALSE, "Field RoleType is not writeable");
preRoleTypeChange (newRoleType);
markFieldChange (FIELD_RoleType);
_RoleType = newRoleType;
postFieldChange (FIELD_RoleType);
postRoleTypeChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
result.add("HiringTeams");
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
return HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO ;
}
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
return HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate ;
}
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
return this.getHiringTeamsCount();
}
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
return this.getHiringTeamsAt(index);
}
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
addToHiringTeams((HiringTeamLinkNPO)newElement);
return;
}
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
removeFromHiringTeams((HiringTeamLinkNPO)oldElement);
return;
}
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
_HiringTeams.__loadAssociation (elements);
return;
}
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
if (MULTIPLEREFERENCE_HiringTeams.equals(attribName))
{
return _HiringTeams.isLoaded ();
}
return super.__isMultiAssocLoaded(attribName);
}
public FieldWriteability getWriteability_HiringTeams ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
public int getHiringTeamsCount () throws StorageException
{
assertValid();
return _HiringTeams.getReferencedObjectsCount ();
}
public void addToHiringTeams (HiringTeamLinkNPO newElement) throws StorageException
{
if (_HiringTeams.wouldAddChange (newElement))
{
assertValid();
Debug.assertion (getWriteability_HiringTeams () != FieldWriteability.FALSE, "MultiAssoc HiringTeams is not writeable (add)");
_HiringTeams.appendElement (newElement);
try
{
if (newElement.getInviteTeammate () != this)
{
newElement.setInviteTeammate ((InviteTeammateNPO)(this));
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public void removeFromHiringTeams (HiringTeamLinkNPO elementToRemove) throws StorageException
{
if (_HiringTeams.wouldRemoveChange (elementToRemove))
{
assertValid();
Debug.assertion (getWriteability_HiringTeams () != FieldWriteability.FALSE, "MultiAssoc HiringTeams is not writeable (remove)");
_HiringTeams.removeElement (elementToRemove);
try
{
if (elementToRemove.getInviteTeammate () != null)
{
elementToRemove.setInviteTeammate (null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public HiringTeamLinkNPO getHiringTeamsAt (int index) throws StorageException
{
return (HiringTeamLinkNPO)(_HiringTeams.getElementAt (index));
}
public SortedSet<HiringTeamLinkNPO> getHiringTeamsSet () throws StorageException
{
return _HiringTeams.getSet ();
}
public void onDelete ()
{
try
{
for(HiringTeamLinkNPO referenced : CollectionUtils.reverse(getHiringTeamsSet()))
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null InviteTeammate from ", getObjectID (), " to ", referenced.getObjectID ());
referenced.setInviteTeammate(null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public InviteTeammateNPO newInstance ()
{
return new InviteTeammateNPO ();
}
public InviteTeammateNPO referenceInstance ()
{
return REFERENCE_InviteTeammateNPO;
}
public InviteTeammateNPO getInTransaction (ObjectTransaction t) throws StorageException
{
return getInviteTeammateNPOByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_InviteTeammateNPO;
}
public String getBaseSetName ()
{
return "it_does_not_matter";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (myID, "it_does_not_matter", myPSetStatus);
it_does_not_matterPSet.setAttrib (FIELD_ObjectID, myID);
it_does_not_matterPSet.setAttrib (FIELD_UserEmail, HELPER_UserEmail.toObject (_UserEmail)); //
it_does_not_matterPSet.setAttrib (FIELD_FirstName, HELPER_FirstName.toObject (_FirstName)); //
it_does_not_matterPSet.setAttrib (FIELD_LastName, HELPER_LastName.toObject (_LastName)); //
it_does_not_matterPSet.setAttrib (FIELD_RoleType, HELPER_RoleType.toObject (_RoleType)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (objectID, "it_does_not_matter");
_UserEmail = (String)(HELPER_UserEmail.fromObject (_UserEmail, it_does_not_matterPSet.getAttrib (FIELD_UserEmail))); //
_FirstName = (String)(HELPER_FirstName.fromObject (_FirstName, it_does_not_matterPSet.getAttrib (FIELD_FirstName))); //
_LastName = (String)(HELPER_LastName.fromObject (_LastName, it_does_not_matterPSet.getAttrib (FIELD_LastName))); //
_RoleType = (RoleType)(HELPER_RoleType.fromObject (_RoleType, it_does_not_matterPSet.getAttrib (FIELD_RoleType))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof InviteTeammateNPO)
{
InviteTeammateNPO otherInviteTeammateNPO = (InviteTeammateNPO)other;
try
{
setUserEmail (otherInviteTeammateNPO.getUserEmail ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setFirstName (otherInviteTeammateNPO.getFirstName ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setLastName (otherInviteTeammateNPO.getLastName ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setRoleType (otherInviteTeammateNPO.getRoleType ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseInviteTeammateNPO)
{
BaseInviteTeammateNPO sourceInviteTeammateNPO = (BaseInviteTeammateNPO)(source);
_UserEmail = sourceInviteTeammateNPO._UserEmail;
_FirstName = sourceInviteTeammateNPO._FirstName;
_LastName = sourceInviteTeammateNPO._LastName;
_RoleType = sourceInviteTeammateNPO._RoleType;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseInviteTeammateNPO)
{
BaseInviteTeammateNPO sourceInviteTeammateNPO = (BaseInviteTeammateNPO)(source);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseInviteTeammateNPO)
{
BaseInviteTeammateNPO sourceInviteTeammateNPO = (BaseInviteTeammateNPO)(source);
_HiringTeams.copyFrom (sourceInviteTeammateNPO._HiringTeams, linkToGhosts);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_UserEmail = (String)(HELPER_UserEmail.readExternal (_UserEmail, vals.get(FIELD_UserEmail))); //
_FirstName = (String)(HELPER_FirstName.readExternal (_FirstName, vals.get(FIELD_FirstName))); //
_LastName = (String)(HELPER_LastName.readExternal (_LastName, vals.get(FIELD_LastName))); //
_RoleType = (RoleType)(HELPER_RoleType.readExternal (_RoleType, vals.get(FIELD_RoleType))); //
_HiringTeams.readExternalData(vals.get(MULTIPLEREFERENCE_HiringTeams));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_UserEmail, HELPER_UserEmail.writeExternal (_UserEmail));
vals.put (FIELD_FirstName, HELPER_FirstName.writeExternal (_FirstName));
vals.put (FIELD_LastName, HELPER_LastName.writeExternal (_LastName));
vals.put (FIELD_RoleType, HELPER_RoleType.writeExternal (_RoleType));
vals.put (MULTIPLEREFERENCE_HiringTeams, _HiringTeams.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseInviteTeammateNPO)
{
BaseInviteTeammateNPO otherInviteTeammateNPO = (BaseInviteTeammateNPO)(other);
if (!HELPER_UserEmail.compare(this._UserEmail, otherInviteTeammateNPO._UserEmail))
{
listener.notifyFieldChange(this, other, FIELD_UserEmail, HELPER_UserEmail.toObject(this._UserEmail), HELPER_UserEmail.toObject(otherInviteTeammateNPO._UserEmail));
}
if (!HELPER_FirstName.compare(this._FirstName, otherInviteTeammateNPO._FirstName))
{
listener.notifyFieldChange(this, other, FIELD_FirstName, HELPER_FirstName.toObject(this._FirstName), HELPER_FirstName.toObject(otherInviteTeammateNPO._FirstName));
}
if (!HELPER_LastName.compare(this._LastName, otherInviteTeammateNPO._LastName))
{
listener.notifyFieldChange(this, other, FIELD_LastName, HELPER_LastName.toObject(this._LastName), HELPER_LastName.toObject(otherInviteTeammateNPO._LastName));
}
if (!HELPER_RoleType.compare(this._RoleType, otherInviteTeammateNPO._RoleType))
{
listener.notifyFieldChange(this, other, FIELD_RoleType, HELPER_RoleType.toObject(this._RoleType), HELPER_RoleType.toObject(otherInviteTeammateNPO._RoleType));
}
// Compare single assocs
// Compare multiple assocs
_HiringTeams.compare (otherInviteTeammateNPO._HiringTeams, listener);
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_UserEmail, HELPER_UserEmail.toObject(getUserEmail()));
visitor.visitField(this, FIELD_FirstName, HELPER_FirstName.toObject(getFirstName()));
visitor.visitField(this, FIELD_LastName, HELPER_LastName.toObject(getLastName()));
visitor.visitField(this, FIELD_RoleType, HELPER_RoleType.toObject(getRoleType()));
visitor.visitAssociation (_HiringTeams);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_HiringTeams))
{
visitor.visit (_HiringTeams);
}
}
public static InviteTeammateNPO createInviteTeammateNPO (ObjectTransaction transaction) throws StorageException
{
InviteTeammateNPO result = new InviteTeammateNPO ();
result.initialiseNewObject (transaction);
return result;
}
public static InviteTeammateNPO getInviteTeammateNPOByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (InviteTeammateNPO)(transaction.getObjectByID (REFERENCE_InviteTeammateNPO, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_UserEmail))
{
return filter.matches (getUserEmail ());
}
else if (attribName.equals (FIELD_FirstName))
{
return filter.matches (getFirstName ());
}
else if (attribName.equals (FIELD_LastName))
{
return filter.matches (getLastName ());
}
else if (attribName.equals (FIELD_RoleType))
{
return filter.matches (getRoleType ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_UserEmail))
{
return HELPER_UserEmail.toObject (getUserEmail ());
}
else if (attribName.equals (FIELD_FirstName))
{
return HELPER_FirstName.toObject (getFirstName ());
}
else if (attribName.equals (FIELD_LastName))
{
return HELPER_LastName.toObject (getLastName ());
}
else if (attribName.equals (FIELD_RoleType))
{
return HELPER_RoleType.toObject (getRoleType ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_UserEmail))
{
return HELPER_UserEmail;
}
else if (attribName.equals (FIELD_FirstName))
{
return HELPER_FirstName;
}
else if (attribName.equals (FIELD_LastName))
{
return HELPER_LastName;
}
else if (attribName.equals (FIELD_RoleType))
{
return HELPER_RoleType;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_UserEmail))
{
setUserEmail ((String)(HELPER_UserEmail.fromObject (_UserEmail, attribValue)));
}
else if (attribName.equals (FIELD_FirstName))
{
setFirstName ((String)(HELPER_FirstName.fromObject (_FirstName, attribValue)));
}
else if (attribName.equals (FIELD_LastName))
{
setLastName ((String)(HELPER_LastName.fromObject (_LastName, attribValue)));
}
else if (attribName.equals (FIELD_RoleType))
{
setRoleType ((RoleType)(HELPER_RoleType.fromObject (_RoleType, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_UserEmail))
{
return getWriteability_UserEmail ();
}
else if (fieldName.equals (FIELD_FirstName))
{
return getWriteability_FirstName ();
}
else if (fieldName.equals (FIELD_LastName))
{
return getWriteability_LastName ();
}
else if (fieldName.equals (FIELD_RoleType))
{
return getWriteability_RoleType ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_HiringTeams))
{
return getWriteability_HiringTeams ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_UserEmail () != FieldWriteability.TRUE)
{
fields.add (FIELD_UserEmail);
}
if (getWriteability_FirstName () != FieldWriteability.TRUE)
{
fields.add (FIELD_FirstName);
}
if (getWriteability_LastName () != FieldWriteability.TRUE)
{
fields.add (FIELD_LastName);
}
if (getWriteability_RoleType () != FieldWriteability.TRUE)
{
fields.add (FIELD_RoleType);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_UserEmail.getAttribObject (getClass (), _UserEmail, false, FIELD_UserEmail));
result.add(HELPER_FirstName.getAttribObject (getClass (), _FirstName, false, FIELD_FirstName));
result.add(HELPER_LastName.getAttribObject (getClass (), _LastName, false, FIELD_LastName));
result.add(HELPER_RoleType.getAttribObject (getClass (), _RoleType, false, FIELD_RoleType));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_InviteTeammateNPO.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_InviteTeammateNPO.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_InviteTeammateNPO.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class InviteTeammateNPOBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<InviteTeammateNPO>
{
/**
* Get the attribute UserEmail
*/
public String getUserEmail (InviteTeammateNPO obj, String original)
{
return original;
}
/**
* Change the value set for attribute UserEmail.
* May modify the field beforehand
* Occurs before validation.
*/
public String setUserEmail (InviteTeammateNPO obj, String newUserEmail) throws FieldException
{
return newUserEmail;
}
/**
* Get the attribute FirstName
*/
public String getFirstName (InviteTeammateNPO obj, String original)
{
return original;
}
/**
* Change the value set for attribute FirstName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setFirstName (InviteTeammateNPO obj, String newFirstName) throws FieldException
{
return newFirstName;
}
/**
* Get the attribute LastName
*/
public String getLastName (InviteTeammateNPO obj, String original)
{
return original;
}
/**
* Change the value set for attribute LastName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setLastName (InviteTeammateNPO obj, String newLastName) throws FieldException
{
return newLastName;
}
/**
* Get the attribute RoleType
*/
public RoleType getRoleType (InviteTeammateNPO obj, RoleType original)
{
return original;
}
/**
* Change the value set for attribute RoleType.
* May modify the field beforehand
* Occurs before validation.
*/
public RoleType setRoleType (InviteTeammateNPO obj, RoleType newRoleType) throws FieldException
{
return newRoleType;
}
}
public ORMPipeLine pipes()
{
return new InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> ((InviteTeammateNPO)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> pipelineInviteTeammateNPO()
{
return (InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO>) pipes();
}
public static InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> pipesInviteTeammateNPO(Collection<InviteTeammateNPO> items)
{
return REFERENCE_InviteTeammateNPO.new InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> (items);
}
public static InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> pipesInviteTeammateNPO(InviteTeammateNPO[] _items)
{
return pipesInviteTeammateNPO(Arrays.asList (_items));
}
public static InviteTeammateNPOPipeLineFactory<InviteTeammateNPO, InviteTeammateNPO> pipesInviteTeammateNPO()
{
return pipesInviteTeammateNPO((Collection)null);
}
public class InviteTeammateNPOPipeLineFactory<From extends BaseBusinessClass, Me extends InviteTeammateNPO> extends NonPersistentBOPipeLineFactory<From, Me>
{
public <Prev> InviteTeammateNPOPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public InviteTeammateNPOPipeLineFactory (From seed)
{
super(seed);
}
public InviteTeammateNPOPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("HiringTeams"))
{
return toHiringTeams ();
}
if (name.equals ("UserEmail"))
{
return toUserEmail ();
}
if (name.equals ("FirstName"))
{
return toFirstName ();
}
if (name.equals ("LastName"))
{
return toLastName ();
}
if (name.equals ("RoleType"))
{
return toRoleType ();
}
return super.to(name);
}
public PipeLine<From, String> toUserEmail () { return pipe(new ORMAttributePipe<Me, String>(FIELD_UserEmail)); }
public PipeLine<From, String> toFirstName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_FirstName)); }
public PipeLine<From, String> toLastName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_LastName)); }
public PipeLine<From, RoleType> toRoleType () { return pipe(new ORMAttributePipe<Me, RoleType>(FIELD_RoleType)); }
public HiringTeamLinkNPO.HiringTeamLinkNPOPipeLineFactory<From, HiringTeamLinkNPO> toHiringTeams () { return toHiringTeams(Filter.ALL); }
public HiringTeamLinkNPO.HiringTeamLinkNPOPipeLineFactory<From, HiringTeamLinkNPO> toHiringTeams (Filter<HiringTeamLinkNPO> filter)
{
return HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO.new HiringTeamLinkNPOPipeLineFactory<From, HiringTeamLinkNPO> (this, new ORMMultiAssocPipe<Me, HiringTeamLinkNPO>(MULTIPLEREFERENCE_HiringTeams, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyInviteTeammateNPO extends InviteTeammateNPO
{
// Default constructor primarily to support Externalisable
public DummyInviteTeammateNPO()
{
super();
}
public void assertValid ()
{
}
public int getHiringTeamsCount () throws StorageException
{
return 0;
}
public HiringTeamLinkNPO getHiringTeamsAt (int index) throws StorageException
{
throw new RuntimeException ("No elements in a dummy object in association HiringTeams");
}
public SortedSet getHiringTeamsSet () throws StorageException
{
return new TreeSet();
}
}
...@@ -70,12 +70,6 @@ public class Company extends BaseCompany ...@@ -70,12 +70,6 @@ public class Company extends BaseCompany
} }
public Boolean isEmailCorrect()
{
return StringUtils.isEmailAddress(StringUtils.subBlanks(getUserEmail()));
}
@Override @Override
public String getToString() public String getToString()
{ {
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
<TRANSIENT name="HiringTeamName" type="String" /> <TRANSIENT name="HiringTeamName" type="String" />
<TRANSIENT name="ManageOwnBilling" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="ManageOwnBilling" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="UserEmail" type="String" />
<TRANSIENT name="FirstName" type="String" />
<TRANSIENT name="LastName" type="String" />
<TRANSIENT name="RoleType" type="RoleType" defaultValue="RoleType.STANDARD" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="CompletedProfile" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="CompletedProfile" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="PaymentJobCount" type="Integer" /> <TRANSIENT name="PaymentJobCount" type="Integer" />
......
package performa.orm; package performa.orm;
import oneit.logging.LoggingArea;
import oneit.objstore.ValidationContext; import oneit.objstore.ValidationContext;
import oneit.utils.StringUtils; import oneit.utils.StringUtils;
...@@ -8,6 +9,8 @@ public class HiringTeam extends BaseHiringTeam ...@@ -8,6 +9,8 @@ public class HiringTeam extends BaseHiringTeam
{ {
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
public static LoggingArea LOG = LoggingArea.createLoggingArea("HiringTeam");
// This constructor should not be called // This constructor should not be called
public HiringTeam () public HiringTeam ()
{ {
......
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import oneit.servlets.orm.*;
public class HiringTeamLinkNPO extends BaseHiringTeamLinkNPO
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public HiringTeamLinkNPO ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="HiringTeamLinkNPO" package="performa.orm" superclass="NonPersistentBO">
<IMPORT value="oneit.servlets.orm.*"/>
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE">
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" />
<SINGLEREFERENCE name="InviteTeammate" type="InviteTeammateNPO" backreferenceName="HiringTeams" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class HiringTeamLinkNPOPersistenceMgr extends NonPersistentBOPersistenceMgr
{
private static final LoggingArea HiringTeamLinkNPOPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "HiringTeamLinkNPO");
// Private attributes corresponding to business object data
// Static constants corresponding to attribute helpers
public HiringTeamLinkNPOPersistenceMgr ()
{
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter., {PREFIX}it_does_not_matter., 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO);
if (objectToReturn instanceof HiringTeamLinkNPO)
{
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a HiringTeamLinkNPO");
}
}
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(id, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(HiringTeamLinkNPO.SINGLEREFERENCE_HiringTeam)||
!it_does_not_matterPSet.containsAttrib(HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
HiringTeamLinkNPO result = new HiringTeamLinkNPO ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " +
"WHERE " + SELECT_JOINS + "{PREFIX}it_does_not_matter.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else if (refName.equals (HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " +
"WHERE " + SELECT_JOINS + " = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET = ? , = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (HiringTeamLinkNPO.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}it_does_not_matter WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "it_does_not_matter", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:it_does_not_matter for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}it_does_not_matter " +
"WHERE it_does_not_matter.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}it_does_not_matter WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:it_does_not_matter for row:" + objectID;
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, HiringTeamLinkNPO> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO.getObjectIDSpace (), r.getLong ("id"));
HiringTeamLinkNPO resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, HiringTeamLinkNPO.REFERENCE_HiringTeamLinkNPO);
if (cachedElement instanceof HiringTeamLinkNPO)
{
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (HiringTeamLinkNPO)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a HiringTeamLinkNPO");
}
}
else
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new HiringTeamLinkNPO ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (HiringTeamLinkNPOPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else
{
BaseBusinessClass[] resultsArray = super.find(searchType, allPSets, criteria, context, sqlMgr);
Vector results = new Vector ();
for (int x = 0 ; x < resultsArray.length ; ++x)
{
if (resultsArray[x] instanceof HiringTeamLinkNPO)
{
results.add (resultsArray[x]);
}
else
{
// Ignore
}
}
resultsArray = new BaseBusinessClass[results.size ()];
results.copyInto (resultsArray);
return resultsArray;
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Object Modified
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(HiringTeamLinkNPO.SINGLEREFERENCE_HiringTeam, r.getObject (""));
it_does_not_matterPSet.setAttrib(HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate, r.getObject (""));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" ( , , object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" ( ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils .listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (HiringTeamLinkNPO.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (HiringTeamLinkNPO.SINGLEREFERENCE_InviteTeammate)))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm;
import oneit.utils.StringUtils;
public class InviteTeammateNPO extends BaseInviteTeammateNPO
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public InviteTeammateNPO ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
public Boolean isEmailCorrect()
{
return StringUtils.isEmailAddress(StringUtils.subBlanks(getUserEmail()));
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="InviteTeammateNPO" package="performa.orm" superclass="NonPersistentBO">
<IMPORT value="oneit.servlets.orm.*"/>
<IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="HiringTeams" type="HiringTeamLinkNPO" backreferenceName="InviteTeammate" />
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="UserEmail" type="String" validators="Email" />
<ATTRIB name="FirstName" type="String" />
<ATTRIB name="LastName" type="String" />
<ATTRIB name="RoleType" type="RoleType" attribHelper="EnumeratedAttributeHelper" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class InviteTeammateNPOPersistenceMgr extends NonPersistentBOPersistenceMgr
{
private static final LoggingArea InviteTeammateNPOPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "InviteTeammateNPO");
// Private attributes corresponding to business object data
private String dummyUserEmail;
private String dummyFirstName;
private String dummyLastName;
private RoleType dummyRoleType;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_UserEmail = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LastName = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_RoleType = new EnumeratedAttributeHelper (RoleType.FACTORY_RoleType);
public InviteTeammateNPOPersistenceMgr ()
{
dummyUserEmail = (String)(HELPER_UserEmail.initialise (dummyUserEmail));
dummyFirstName = (String)(HELPER_FirstName.initialise (dummyFirstName));
dummyLastName = (String)(HELPER_LastName.initialise (dummyLastName));
dummyRoleType = (RoleType)(HELPER_RoleType.initialise (dummyRoleType));
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter., {PREFIX}it_does_not_matter., {PREFIX}it_does_not_matter., {PREFIX}it_does_not_matter., 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, InviteTeammateNPO.REFERENCE_InviteTeammateNPO);
if (objectToReturn instanceof InviteTeammateNPO)
{
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a InviteTeammateNPO");
}
}
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(id, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(InviteTeammateNPO.FIELD_UserEmail)||
!it_does_not_matterPSet.containsAttrib(InviteTeammateNPO.FIELD_FirstName)||
!it_does_not_matterPSet.containsAttrib(InviteTeammateNPO.FIELD_LastName)||
!it_does_not_matterPSet.containsAttrib(InviteTeammateNPO.FIELD_RoleType))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
InviteTeammateNPO result = new InviteTeammateNPO ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " +
"WHERE " + SELECT_JOINS + "{PREFIX}it_does_not_matter.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET = ?, = ?, = ?, = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_UserEmail.getForSQL(dummyUserEmail, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_UserEmail))).listEntry (HELPER_FirstName.getForSQL(dummyFirstName, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_FirstName))).listEntry (HELPER_LastName.getForSQL(dummyLastName, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_LastName))).listEntry (HELPER_RoleType.getForSQL(dummyRoleType, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_RoleType))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}it_does_not_matter WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "it_does_not_matter", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:it_does_not_matter for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}it_does_not_matter " +
"WHERE it_does_not_matter.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}it_does_not_matter WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:it_does_not_matter for row:" + objectID;
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, InviteTeammateNPO> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (InviteTeammateNPO.REFERENCE_InviteTeammateNPO.getObjectIDSpace (), r.getLong ("id"));
InviteTeammateNPO resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, InviteTeammateNPO.REFERENCE_InviteTeammateNPO);
if (cachedElement instanceof InviteTeammateNPO)
{
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (InviteTeammateNPO)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a InviteTeammateNPO");
}
}
else
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new InviteTeammateNPO ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (InviteTeammateNPOPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else
{
BaseBusinessClass[] resultsArray = super.find(searchType, allPSets, criteria, context, sqlMgr);
Vector results = new Vector ();
for (int x = 0 ; x < resultsArray.length ; ++x)
{
if (resultsArray[x] instanceof InviteTeammateNPO)
{
results.add (resultsArray[x]);
}
else
{
// Ignore
}
}
resultsArray = new BaseBusinessClass[results.size ()];
results.copyInto (resultsArray);
return resultsArray;
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Object Modified
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(InviteTeammateNPO.FIELD_UserEmail, HELPER_UserEmail.getFromRS(dummyUserEmail, r, ""));
it_does_not_matterPSet.setAttrib(InviteTeammateNPO.FIELD_FirstName, HELPER_FirstName.getFromRS(dummyFirstName, r, ""));
it_does_not_matterPSet.setAttrib(InviteTeammateNPO.FIELD_LastName, HELPER_LastName.getFromRS(dummyLastName, r, ""));
it_does_not_matterPSet.setAttrib(InviteTeammateNPO.FIELD_RoleType, HELPER_RoleType.getFromRS(dummyRoleType, r, ""));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" (, , , , object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_UserEmail.getForSQL(dummyUserEmail, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_UserEmail))).listEntry (HELPER_FirstName.getForSQL(dummyFirstName, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_FirstName))).listEntry (HELPER_LastName.getForSQL(dummyLastName, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_LastName))).listEntry (HELPER_RoleType.getForSQL(dummyRoleType, it_does_not_matterPSet.getAttrib (InviteTeammateNPO.FIELD_RoleType))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -359,6 +359,23 @@ public class Utils ...@@ -359,6 +359,23 @@ public class Utils
return Boolean.FALSE; return Boolean.FALSE;
} }
public static Boolean userFoundInAnotherCompany(ObjectTransaction objTran, String email, Company company)
{
if(email != null)
{
SecUser user = SecUser.searchNAME(objTran, email.toLowerCase());
if(user != null && user.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
{
CompanyUser companyUser = user.getExtension(CompanyUser.REFERENCE_CompanyUser);
return !CollectionUtils.equals(companyUser.getCompany(), company);
}
}
return Boolean.FALSE;
}
public static Boolean isCompanyUserEmailFound(ObjectTransaction objTran, String email, CompanyUser currentUser) public static Boolean isCompanyUserEmailFound(ObjectTransaction objTran, String email, CompanyUser currentUser)
{ {
if(email!=null) if(email!=null)
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<FORM name="*.addHiringTeam" factory="Participant" class="performa.form.AddHiringTeamFP"/> <FORM name="*.addHiringTeam" factory="Participant" class="performa.form.AddHiringTeamFP"/>
<FORM name="*.saveCompanyUser" factory="Participant" class="performa.form.SaveCompanyUserFP"/> <FORM name="*.saveCompanyUser" factory="Participant" class="performa.form.SaveCompanyUserFP"/>
<FORM name="*.selectHiringTeam" factory="Participant" class="performa.form.SelectHiringTeamFP"/> <FORM name="*.selectHiringTeam" factory="Participant" class="performa.form.SelectHiringTeamFP"/>
<FORM name="*.additionalTeam" factory="Participant" class="performa.form.AddAdditionalHiringTeamFP"/>
</NODE> </NODE>
<NODE name="job_assessment_criteria_add_jsp" factory="Participant"> <NODE name="job_assessment_criteria_add_jsp" factory="Participant">
......
...@@ -20,9 +20,18 @@ ...@@ -20,9 +20,18 @@
Collection companyUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)).andIsDisabled(new EqualsFilter<>(Boolean.FALSE))); Collection companyUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)).andIsDisabled(new EqualsFilter<>(Boolean.FALSE)));
Collection pendingUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE))); Collection pendingUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE)));
Collection disabledUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)).andIsDisabled(new EqualsFilter<>(Boolean.TRUE))); Collection disabledUsers = CollectionFilter.filter(allUsers, CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)).andIsDisabled(new EqualsFilter<>(Boolean.TRUE)));
InviteTeammateNPO inviteTeammate = (InviteTeammateNPO) process.getAttribute("InviteTeammate");
Debug.assertion(hiringTeam != null, "Hiring Team is null in admin portal Manage Teammates"); Debug.assertion(hiringTeam != null, "Hiring Team is null in admin portal Manage Teammates");
if(inviteTeammate == null)
{
inviteTeammate = InviteTeammateNPO.createInviteTeammateNPO(objTran);
inviteTeammate.addToHiringTeams(HiringTeamLinkNPO.createHiringTeamLinkNPO(objTran));
process.setAttribute("InviteTeammate", inviteTeammate);
}
if(company == null) if(company == null)
{ {
company = comUser.getCompany(); company = comUser.getCompany();
...@@ -45,7 +54,7 @@ ...@@ -45,7 +54,7 @@
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt); Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
Collection<CompanyUser> sortedDisabledUsers = Utils.getUsersSorted(disabledUsers, userSortOpt); Collection<CompanyUser> sortedDisabledUsers = Utils.getUsersSorted(disabledUsers, userSortOpt);
company.setRoleType(RoleType.STANDARD); inviteTeammate.setRoleType(RoleType.STANDARD);
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -280,24 +289,42 @@ ...@@ -280,24 +289,42 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Email Address" /></label> <label><oneit:label GUIName="Email Address" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="UserEmail" cssClass="form-control" style="text-transform: lowercase"/> <oneit:ormInput obj="<%= inviteTeammate %>" type="text" attributeName="UserEmail" cssClass="form-control" style="text-transform: lowercase"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="First Name" /></label> <label><oneit:label GUIName="First Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="FirstName" cssClass="form-control"/> <oneit:ormInput obj="<%= inviteTeammate %>" type="text" attributeName="FirstName" cssClass="form-control"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Last Name" /></label> <label><oneit:label GUIName="Last Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="LastName" cssClass="form-control"/> <oneit:ormInput obj="<%= inviteTeammate %>" type="text" attributeName="LastName" cssClass="form-control"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Role" /></label> <label><oneit:label GUIName="Role" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/> <oneit:ormEnum obj="<%= inviteTeammate %>" attributeName="RoleType" cssClass="form-control"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Add to multiple Hiring Teams" /></label>
</div>
<%
for(HiringTeamLinkNPO inviteTeammateLink : inviteTeammate.getHiringTeamsSet())
{
%>
<div class="form-group">
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= inviteTeammateLink %>" assocName="HiringTeam" options="<%= Utils.getOtherHiringTeams(hiringTeam) %>"/>
</div>
</div> </div>
<%
}
%>
<oneit:button value=" " name="additionalTeam" skin="link" requestAttribs="<%= CollectionUtils.EMPTY_MAP %>">
<label><oneit:label GUIName="Add another hiring team" /></label>
</oneit:button>
<div class="correctEmail" > <div class="correctEmail" >
<oneit:recalc mode="Boolean" script="company.isEmailCorrect()" company="<%= company %>" /> <oneit:recalc mode="Boolean" script="company.isEmailCorrect()" company="<%= company %>" />
</div> </div>
<oneit:recalcClass htmlTag="div" classScript="company.isEmailCorrect() ? 'invite-btn enabled': 'invite-btn disabled'" company="<%= company %>"> <oneit:recalcClass htmlTag="div" classScript="inviteTeammate.isEmailCorrect() ? 'invite-btn enabled': 'invite-btn disabled'" inviteTeammate="<%= inviteTeammate %>">
<oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite" <oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
......
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
#completeCulture = Please complete workplace preferences. #completeCulture = Please complete workplace preferences.
#completeAssessment = Please complete your experience. #completeAssessment = Please complete your experience.
#emailExists = An account already exists with this email address. #emailExists = An account already exists with this email address.
#existsInOtherCompany = An account with this email address is already associated with another company.
#emailSent = A verification email has been sent to you. Please check your email :). #emailSent = A verification email has been sent to you. Please check your email :).
#alreadyApplied = You have already applied for this job. #alreadyApplied = You have already applied for this job.
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