/*
 * IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
 * Template: Infrastructure9.0 [oneit.objstore.BusinessObjectTemplate.xsl]
 *   Vendor: Apache Software Foundation (Xalan XSLTC) (Version: 1.0)
 */

    
package performa.orm;

import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;

import performa.orm.types.*;


public abstract class BaseJobApplication extends BaseBusinessClass
{
    // Reference instance for the object
    public static final JobApplication REFERENCE_JobApplication = new JobApplication ();

    // Reference instance for the object
    public static final JobApplication DUMMY_JobApplication = new DummyJobApplication ();

    // Static constants corresponding to field names
    
    public static final String FIELD_CV = "CV";
    public static final String FIELD_CoverLetter = "CoverLetter";
    public static final String FIELD_ApplicationStatus = "ApplicationStatus";
    public static final String FIELD_SubmittedDate = "SubmittedDate";
    public static final String FIELD_GoogleAddressText = "GoogleAddressText";
    public static final String FIELD_PreferRemote = "PreferRemote";
    public static final String FIELD_HappyToRelocate = "HappyToRelocate";
    public static final String FIELD_IsEmailIngest = "IsEmailIngest";
    public static final String FIELD_ApplicantSource = "ApplicantSource";
    public static final String FIELD_AppProcessOption = "AppProcessOption";
    public static final String FIELD_OverallRank = "OverallRank";
    public static final String FIELD_RoleFit = "RoleFit";
    public static final String FIELD_RequirementFit = "RequirementFit";
    public static final String FIELD_CultureFit = "CultureFit";
    public static final String FIELD_FactorScoreDetails = "FactorScoreDetails";
    public static final String FIELD_Note = "Note";
    public static final String SINGLEREFERENCE_Candidate = "Candidate";
    public static final String BACKREF_Candidate = "";
    public static final String SINGLEREFERENCE_Job = "Job";
    public static final String BACKREF_Job = "";
    public static final String SINGLEREFERENCE_WorkFlowStage = "WorkFlowStage";
    public static final String MULTIPLEREFERENCE_AssessmentCriteriaAnswers = "AssessmentCriteriaAnswers";
    public static final String BACKREF_AssessmentCriteriaAnswers = "";
    public static final String MULTIPLEREFERENCE_Notes = "Notes";
    public static final String BACKREF_Notes = "";
    public static final String MULTIPLEREFERENCE_ScheduledEmails = "ScheduledEmails";
    public static final String BACKREF_ScheduledEmails = "";
    public static final String MULTIPLEREFERENCE_SentEmails = "SentEmails";
    public static final String BACKREF_SentEmails = "";
    public static final String MULTIPLEREFERENCE_Messages = "Messages";
    public static final String BACKREF_Messages = "";

    // Static constants corresponding to searches
    public static final String SEARCH_All = "All";
    public static final String SEARCH_CandidateJob = "CandidateJob";
    public static final String SEARCH_Details = "Details";
    public static final String SEARCH_StageType = "StageType";
    

    // Static constants corresponding to attribute helpers
    private static final BLOBAttributeHelper HELPER_CV = BLOBAttributeHelper.INSTANCE;
    private static final BLOBAttributeHelper HELPER_CoverLetter = BLOBAttributeHelper.INSTANCE;
    private static final EnumeratedAttributeHelper<JobApplication, ApplicationStatus> HELPER_ApplicationStatus =  new EnumeratedAttributeHelper<JobApplication, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
    private static final DefaultAttributeHelper<JobApplication> HELPER_SubmittedDate = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<JobApplication> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<JobApplication> HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<JobApplication> HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<JobApplication> HELPER_IsEmailIngest = DefaultAttributeHelper.INSTANCE;
    private static final EnumeratedAttributeHelper<JobApplication, ApplicantSource> HELPER_ApplicantSource =  new EnumeratedAttributeHelper<JobApplication, ApplicantSource> (ApplicantSource.FACTORY_ApplicantSource);
    private static final EnumeratedAttributeHelper<JobApplication, AppProcessOption> HELPER_AppProcessOption =  new EnumeratedAttributeHelper<JobApplication, AppProcessOption> (AppProcessOption.FACTORY_AppProcessOption);
    private static final DefaultAttributeHelper<JobApplication> HELPER_OverallRank = DefaultAttributeHelper.INSTANCE;
    private static final BLOBAttributeHelper HELPER_RoleFit = BLOBAttributeHelper.INSTANCE;
    private static final BLOBAttributeHelper HELPER_RequirementFit = BLOBAttributeHelper.INSTANCE;
    private static final BLOBAttributeHelper HELPER_CultureFit = BLOBAttributeHelper.INSTANCE;
    private static final BLOBAttributeHelper HELPER_FactorScoreDetails = BLOBAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<JobApplication> HELPER_Note = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private BinaryContent _CV;
    private BinaryContent _CoverLetter;
    private ApplicationStatus _ApplicationStatus;
    private Date _SubmittedDate;
    private String _GoogleAddressText;
    private Boolean _PreferRemote;
    private Boolean _HappyToRelocate;
    private Boolean _IsEmailIngest;
    private ApplicantSource _ApplicantSource;
    private AppProcessOption _AppProcessOption;
    private Integer _OverallRank;
    private Map _RoleFit;
    private Map _RequirementFit;
    private Map _CultureFit;
    private Map _FactorScoreDetails;
    private String _Note;
    

    // Private attributes corresponding to single references
    private SingleAssociation<JobApplication, Candidate> _Candidate;
    private SingleAssociation<JobApplication, Job> _Job;
    private SingleAssociation<JobApplication, WorkFlowStage> _WorkFlowStage;
    

    // Private attributes corresponding to multiple references
    private MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> _AssessmentCriteriaAnswers;
    private MultipleAssociation<JobApplication, Note> _Notes;
    private MultipleAssociation<JobApplication, ScheduledEmail> _ScheduledEmails;
    private MultipleAssociation<JobApplication, SentEmail> _SentEmails;
    private MultipleAssociation<JobApplication, Message> _Messages;
    

    // Map of maps of metadata
    private static final Map ATTRIBUTES_METADATA_JobApplication = new LinkedHashMap ();

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_AppProcessOption_Validators;
    private static final AttributeValidator[] FIELD_OverallRank_Validators;
    private static final AttributeValidator[] FIELD_RoleFit_Validators;
    private static final AttributeValidator[] FIELD_RequirementFit_Validators;
    private static final AttributeValidator[] FIELD_CultureFit_Validators;
    private static final AttributeValidator[] FIELD_FactorScoreDetails_Validators;
    private static final AttributeValidator[] FIELD_Note_Validators;
    private static final AttributeValidator[] FIELD_CV_Validators;
    private static final AttributeValidator[] FIELD_CoverLetter_Validators;
    private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
    private static final AttributeValidator[] FIELD_SubmittedDate_Validators;
    private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
    private static final AttributeValidator[] FIELD_PreferRemote_Validators;
    private static final AttributeValidator[] FIELD_HappyToRelocate_Validators;
    private static final AttributeValidator[] FIELD_IsEmailIngest_Validators;
    private static final AttributeValidator[] FIELD_ApplicantSource_Validators;
    

    // Arrays of AttributeDecorators for each attribute
    private static final AttributeDecorator<JobApplication, AppProcessOption>[] FIELD_AppProcessOption_Decorators;
    private static final AttributeDecorator<JobApplication, Integer>[] FIELD_OverallRank_Decorators;
    private static final AttributeDecorator<JobApplication, Map>[] FIELD_RoleFit_Decorators;
    private static final AttributeDecorator<JobApplication, Map>[] FIELD_RequirementFit_Decorators;
    private static final AttributeDecorator<JobApplication, Map>[] FIELD_CultureFit_Decorators;
    private static final AttributeDecorator<JobApplication, Map>[] FIELD_FactorScoreDetails_Decorators;
    private static final AttributeDecorator<JobApplication, String>[] FIELD_Note_Decorators;
    private static final AttributeDecorator<JobApplication, BinaryContent>[] FIELD_CV_Decorators;
    private static final AttributeDecorator<JobApplication, BinaryContent>[] FIELD_CoverLetter_Decorators;
    private static final AttributeDecorator<JobApplication, ApplicationStatus>[] FIELD_ApplicationStatus_Decorators;
    private static final AttributeDecorator<JobApplication, Date>[] FIELD_SubmittedDate_Decorators;
    private static final AttributeDecorator<JobApplication, String>[] FIELD_GoogleAddressText_Decorators;
    private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_PreferRemote_Decorators;
    private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_HappyToRelocate_Decorators;
    private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_IsEmailIngest_Decorators;
    private static final AttributeDecorator<JobApplication, ApplicantSource>[] FIELD_ApplicantSource_Decorators;
    
    
    // Arrays of SingleAssocDecorators for each attribute
    private static final SingleAssocDecorator<JobApplication, Candidate>[] SINGLEREFERENCE_Candidate_Decorators;
    private static final SingleAssocDecorator<JobApplication, Job>[] SINGLEREFERENCE_Job_Decorators;
    private static final SingleAssocDecorator<JobApplication, WorkFlowStage>[] SINGLEREFERENCE_WorkFlowStage_Decorators;
    
    
    // Arrays of MultiAssocDecorators for each attribute
    private static final MultiAssocDecorator<JobApplication, AssessmentCriteriaAnswer>[] MULTIPLEREFERENCE_AssessmentCriteriaAnswers_Decorators;
    private static final MultiAssocDecorator<JobApplication, Note>[] MULTIPLEREFERENCE_Notes_Decorators;
    private static final MultiAssocDecorator<JobApplication, ScheduledEmail>[] MULTIPLEREFERENCE_ScheduledEmails_Decorators;
    private static final MultiAssocDecorator<JobApplication, SentEmail>[] MULTIPLEREFERENCE_SentEmails_Decorators;
    private static final MultiAssocDecorator<JobApplication, Message>[] MULTIPLEREFERENCE_Messages_Decorators;
    

    // Arrays of behaviour decorators
    private static final JobApplicationBehaviourDecorator[] JobApplication_BehaviourDecorators;
    
    static
    {
        try
        {
            
            String tmp_AssessmentCriteriaAnswers = AssessmentCriteriaAnswer.BACKREF_JobApplication;
            String tmp_Notes = Note.BACKREF_JobApplication;
            String tmp_ScheduledEmails = ScheduledEmail.BACKREF_JobApplication;
            String tmp_SentEmails = SentEmail.BACKREF_JobApplication;
            String tmp_Messages = Message.BACKREF_JobApplication;
            String tmp_Candidate = Candidate.BACKREF_JobApplications;
            String tmp_Job = Job.BACKREF_JobApplications;
            
            Map  validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));

            setupAssocMetaData_AssessmentCriteriaAnswers();
            setupAssocMetaData_Notes();
            setupAssocMetaData_ScheduledEmails();
            setupAssocMetaData_SentEmails();
            setupAssocMetaData_Messages();
            setupAssocMetaData_Candidate();
            setupAssocMetaData_Job();
            setupAssocMetaData_WorkFlowStage();
            FIELD_AppProcessOption_Validators = (AttributeValidator[])setupAttribMetaData_AppProcessOption(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_OverallRank_Validators = (AttributeValidator[])setupAttribMetaData_OverallRank(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_RoleFit_Validators = (AttributeValidator[])setupAttribMetaData_RoleFit(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_RequirementFit_Validators = (AttributeValidator[])setupAttribMetaData_RequirementFit(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_CultureFit_Validators = (AttributeValidator[])setupAttribMetaData_CultureFit(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_FactorScoreDetails_Validators = (AttributeValidator[])setupAttribMetaData_FactorScoreDetails(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Note_Validators = (AttributeValidator[])setupAttribMetaData_Note(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_CV_Validators = (AttributeValidator[])setupAttribMetaData_CV(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_CoverLetter_Validators = (AttributeValidator[])setupAttribMetaData_CoverLetter(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_SubmittedDate_Validators = (AttributeValidator[])setupAttribMetaData_SubmittedDate(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_PreferRemote_Validators = (AttributeValidator[])setupAttribMetaData_PreferRemote(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_HappyToRelocate_Validators = (AttributeValidator[])setupAttribMetaData_HappyToRelocate(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_IsEmailIngest_Validators = (AttributeValidator[])setupAttribMetaData_IsEmailIngest(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ApplicantSource_Validators = (AttributeValidator[])setupAttribMetaData_ApplicantSource(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_AppProcessOption_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_AppProcessOption).toArray (new AttributeDecorator[0]);
            FIELD_OverallRank_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_OverallRank).toArray (new AttributeDecorator[0]);
            FIELD_RoleFit_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_RoleFit).toArray (new AttributeDecorator[0]);
            FIELD_RequirementFit_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_RequirementFit).toArray (new AttributeDecorator[0]);
            FIELD_CultureFit_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_CultureFit).toArray (new AttributeDecorator[0]);
            FIELD_FactorScoreDetails_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_FactorScoreDetails).toArray (new AttributeDecorator[0]);
            FIELD_Note_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_Note).toArray (new AttributeDecorator[0]);
            FIELD_CV_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_CV).toArray (new AttributeDecorator[0]);
            FIELD_CoverLetter_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_CoverLetter).toArray (new AttributeDecorator[0]);
            FIELD_ApplicationStatus_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_ApplicationStatus).toArray (new AttributeDecorator[0]);
            FIELD_SubmittedDate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_SubmittedDate).toArray (new AttributeDecorator[0]);
            FIELD_GoogleAddressText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_GoogleAddressText).toArray (new AttributeDecorator[0]);
            FIELD_PreferRemote_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_PreferRemote).toArray (new AttributeDecorator[0]);
            FIELD_HappyToRelocate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_HappyToRelocate).toArray (new AttributeDecorator[0]);
            FIELD_IsEmailIngest_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_IsEmailIngest).toArray (new AttributeDecorator[0]);
            FIELD_ApplicantSource_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_ApplicantSource).toArray (new AttributeDecorator[0]);
            SINGLEREFERENCE_Candidate_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_Candidate).toArray (new SingleAssocDecorator[0]);
            SINGLEREFERENCE_Job_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_Job).toArray (new SingleAssocDecorator[0]);
            SINGLEREFERENCE_WorkFlowStage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_WorkFlowStage).toArray (new SingleAssocDecorator[0]);
            MULTIPLEREFERENCE_AssessmentCriteriaAnswers_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_JobApplication, MULTIPLEREFERENCE_AssessmentCriteriaAnswers).toArray (new MultiAssocDecorator[0]);
            MULTIPLEREFERENCE_Notes_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_JobApplication, MULTIPLEREFERENCE_Notes).toArray (new MultiAssocDecorator[0]);
            MULTIPLEREFERENCE_ScheduledEmails_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_JobApplication, MULTIPLEREFERENCE_ScheduledEmails).toArray (new MultiAssocDecorator[0]);
            MULTIPLEREFERENCE_SentEmails_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_JobApplication, MULTIPLEREFERENCE_SentEmails).toArray (new MultiAssocDecorator[0]);
            MULTIPLEREFERENCE_Messages_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_JobApplication, MULTIPLEREFERENCE_Messages).toArray (new MultiAssocDecorator[0]);
            

            REFERENCE_JobApplication.initialiseReference ();
            DUMMY_JobApplication.initialiseReference ();
            JobApplication_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(JobApplication.class).toArray(new JobApplicationBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

    
    private static void setupAssocMetaData_AssessmentCriteriaAnswers()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplication");
        metaInfo.put ("name", "AssessmentCriteriaAnswers");
        metaInfo.put ("type", "AssessmentCriteriaAnswer");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.AssessmentCriteriaAnswers:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_AssessmentCriteriaAnswers, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_Notes()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplication");
        metaInfo.put ("name", "Notes");
        metaInfo.put ("type", "Note");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.Notes:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_Notes, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_ScheduledEmails()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplication");
        metaInfo.put ("name", "ScheduledEmails");
        metaInfo.put ("type", "ScheduledEmail");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.ScheduledEmails:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_ScheduledEmails, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_SentEmails()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplication");
        metaInfo.put ("name", "SentEmails");
        metaInfo.put ("type", "SentEmail");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.SentEmails:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_SentEmails, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_Messages()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplication");
        metaInfo.put ("name", "Messages");
        metaInfo.put ("type", "Message");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.Messages:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_Messages, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_Candidate()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplications");
        metaInfo.put ("dbcol", "candidate_id");
        metaInfo.put ("mandatory", "true");
        metaInfo.put ("name", "Candidate");
        metaInfo.put ("type", "Candidate");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.Candidate:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (SINGLEREFERENCE_Candidate, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_Job()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "JobApplications");
        metaInfo.put ("dbcol", "job_id");
        metaInfo.put ("mandatory", "true");
        metaInfo.put ("name", "Job");
        metaInfo.put ("type", "Job");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.Job:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (SINGLEREFERENCE_Job, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static void setupAssocMetaData_WorkFlowStage()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("dbcol", "work_flow_stage_id");
        metaInfo.put ("mandatory", "false");
        metaInfo.put ("name", "WorkFlowStage");
        metaInfo.put ("type", "WorkFlowStage");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.WorkFlowStage:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (SINGLEREFERENCE_WorkFlowStage, Collections.unmodifiableMap (metaInfo));
    }
    
    
    private static List setupAttribMetaData_AppProcessOption(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
        metaInfo.put ("name", "AppProcessOption");
        metaInfo.put ("type", "AppProcessOption");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.AppProcessOption:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_AppProcessOption, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "AppProcessOption", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.AppProcessOption:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_OverallRank(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("name", "OverallRank");
        metaInfo.put ("type", "Integer");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.OverallRank:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_OverallRank, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "OverallRank", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.OverallRank:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_RoleFit(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("name", "RoleFit");
        metaInfo.put ("type", "Map");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.RoleFit:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_RoleFit, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "RoleFit", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.RoleFit:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_RequirementFit(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("name", "RequirementFit");
        metaInfo.put ("type", "Map");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.RequirementFit:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_RequirementFit, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "RequirementFit", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.RequirementFit:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_CultureFit(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("name", "CultureFit");
        metaInfo.put ("type", "Map");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.CultureFit:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_CultureFit, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "CultureFit", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.CultureFit:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_FactorScoreDetails(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("name", "FactorScoreDetails");
        metaInfo.put ("type", "Map");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.FactorScoreDetails:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_FactorScoreDetails, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "FactorScoreDetails", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.FactorScoreDetails:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_Note(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("name", "Note");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.Note:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_Note, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "Note", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.Note:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_CV(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("binaryHandler", "loggedin");
        metaInfo.put ("dbcol", "cv");
        metaInfo.put ("mandatory", "false");
        metaInfo.put ("name", "CV");
        metaInfo.put ("type", "BinaryContent");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.CV:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_CV, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "CV", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.CV:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_CoverLetter(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "BLOBAttributeHelper");
        metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
        metaInfo.put ("binaryHandler", "loggedin");
        metaInfo.put ("dbcol", "cover_letter");
        metaInfo.put ("mandatory", "false");
        metaInfo.put ("name", "CoverLetter");
        metaInfo.put ("type", "BinaryContent");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.CoverLetter:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_CoverLetter, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "CoverLetter", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.CoverLetter:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_ApplicationStatus(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
        metaInfo.put ("dbcol", "application_status");
        metaInfo.put ("defaultValue", "ApplicationStatus.DRAFT");
        metaInfo.put ("mandatory", "true");
        metaInfo.put ("name", "ApplicationStatus");
        metaInfo.put ("type", "ApplicationStatus");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.ApplicationStatus:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_ApplicationStatus, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "ApplicationStatus", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.ApplicationStatus:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_SubmittedDate(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "submitted_date");
        metaInfo.put ("name", "SubmittedDate");
        metaInfo.put ("type", "Date");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.SubmittedDate:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_SubmittedDate, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "SubmittedDate", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.SubmittedDate:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_GoogleAddressText(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "google_address_text");
        metaInfo.put ("length", "300");
        metaInfo.put ("name", "GoogleAddressText");
        metaInfo.put ("type", "String");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.GoogleAddressText:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_GoogleAddressText, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "GoogleAddressText", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.GoogleAddressText:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_PreferRemote(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "prefer_remote");
        metaInfo.put ("defaultValue", "Boolean.FALSE");
        metaInfo.put ("name", "PreferRemote");
        metaInfo.put ("type", "Boolean");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.PreferRemote:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_PreferRemote, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "PreferRemote", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.PreferRemote:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_HappyToRelocate(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "happy_to_relocate");
        metaInfo.put ("name", "HappyToRelocate");
        metaInfo.put ("type", "Boolean");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.HappyToRelocate:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_HappyToRelocate, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "HappyToRelocate", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.HappyToRelocate:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_IsEmailIngest(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "is_email_ingest");
        metaInfo.put ("defaultValue", "Boolean.FALSE");
        metaInfo.put ("name", "IsEmailIngest");
        metaInfo.put ("type", "Boolean");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.IsEmailIngest:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_IsEmailIngest, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "IsEmailIngest", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.IsEmailIngest:", validators);        

        return validators;
    }
    
    private static List setupAttribMetaData_ApplicantSource(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
        metaInfo.put ("dbcol", "applicant_source");
        metaInfo.put ("defaultValue", "ApplicantSource.APPLY_URL");
        metaInfo.put ("mandatory", "false");
        metaInfo.put ("name", "ApplicantSource");
        metaInfo.put ("type", "ApplicantSource");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.ApplicantSource:", metaInfo);
        ATTRIBUTES_METADATA_JobApplication.put (FIELD_ApplicantSource, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "ApplicantSource", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.ApplicantSource:", validators);        

        return validators;
    }
    
    // END OF STATIC METADATA DEFINITION    
    
    
    
    // This constructor should not be called
    protected BaseJobApplication ()
    {
    }


    protected BBCBehaviourDecorator[] getBehaviours()
    {
        return JobApplication_BehaviourDecorators;
    }

    


    protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
    {
        super._initialiseNewObjAttributes (transaction);

        
        _CV = (BinaryContent)(HELPER_CV.initialise (_CV));
        _CoverLetter = (BinaryContent)(HELPER_CoverLetter.initialise (_CoverLetter));
        _ApplicationStatus = (ApplicationStatus)(ApplicationStatus.DRAFT);
        _SubmittedDate = (Date)(HELPER_SubmittedDate.initialise (_SubmittedDate));
        _GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
        _PreferRemote = (Boolean)(Boolean.FALSE);
        _HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (_HappyToRelocate));
        _IsEmailIngest = (Boolean)(Boolean.FALSE);
        _ApplicantSource = (ApplicantSource)(ApplicantSource.APPLY_URL);
        _AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.initialise (_AppProcessOption));
        _OverallRank = (Integer)(HELPER_OverallRank.initialise (_OverallRank));
        _RoleFit = (Map)(HELPER_RoleFit.initialise (_RoleFit));
        _RequirementFit = (Map)(HELPER_RequirementFit.initialise (_RequirementFit));
        _CultureFit = (Map)(HELPER_CultureFit.initialise (_CultureFit));
        _FactorScoreDetails = (Map)(HELPER_FactorScoreDetails.initialise (_FactorScoreDetails));
        _Note = (String)(HELPER_Note.initialise (_Note));
    }


    protected void _initialiseAssociations ()
    {
        super._initialiseAssociations ();

        _Candidate = new SingleAssociation<JobApplication, Candidate> (this, SINGLEREFERENCE_Candidate, Candidate.MULTIPLEREFERENCE_JobApplications, Candidate.REFERENCE_Candidate, "tl_job_application");
        _Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application");
        _WorkFlowStage = new SingleAssociation<JobApplication, WorkFlowStage> (this, SINGLEREFERENCE_WorkFlowStage, null, WorkFlowStage.REFERENCE_WorkFlowStage, "tl_job_application");
        _AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer);_Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note);_ScheduledEmails = new MultipleAssociation<JobApplication, ScheduledEmail> (this, MULTIPLEREFERENCE_ScheduledEmails, ScheduledEmail.SINGLEREFERENCE_JobApplication, ScheduledEmail.REFERENCE_ScheduledEmail);_SentEmails = new MultipleAssociation<JobApplication, SentEmail> (this, MULTIPLEREFERENCE_SentEmails, SentEmail.SINGLEREFERENCE_JobApplication, SentEmail.REFERENCE_SentEmail);_Messages = new MultipleAssociation<JobApplication, Message> (this, MULTIPLEREFERENCE_Messages, Message.SINGLEREFERENCE_JobApplication, Message.REFERENCE_Message);
    }


    protected BaseBusinessClass initialiseReference ()
    {
        super.initialiseReference ();
        
        _Candidate = new SingleAssociation<JobApplication, Candidate> (this, SINGLEREFERENCE_Candidate, Candidate.MULTIPLEREFERENCE_JobApplications, Candidate.REFERENCE_Candidate, "tl_job_application");
        _Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application");
        _WorkFlowStage = new SingleAssociation<JobApplication, WorkFlowStage> (this, SINGLEREFERENCE_WorkFlowStage, null, WorkFlowStage.REFERENCE_WorkFlowStage, "tl_job_application");
        _AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer);_Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note);_ScheduledEmails = new MultipleAssociation<JobApplication, ScheduledEmail> (this, MULTIPLEREFERENCE_ScheduledEmails, ScheduledEmail.SINGLEREFERENCE_JobApplication, ScheduledEmail.REFERENCE_ScheduledEmail);_SentEmails = new MultipleAssociation<JobApplication, SentEmail> (this, MULTIPLEREFERENCE_SentEmails, SentEmail.SINGLEREFERENCE_JobApplication, SentEmail.REFERENCE_SentEmail);_Messages = new MultipleAssociation<JobApplication, Message> (this, MULTIPLEREFERENCE_Messages, Message.SINGLEREFERENCE_JobApplication, Message.REFERENCE_Message);
        
        return this;
    }


    /**
     * Attribute CV
     */
    public BinaryContent getCV ()
    {
        assertValid();
        BinaryContent valToReturn = AttributeDecoratorUtils.getValue (FIELD_CV_Decorators, (JobApplication)this, FIELD_CV, _CV);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getCV ((JobApplication)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 preCVChange (BinaryContent newCV) 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 postCVChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_CV ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute CV.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setCV (BinaryContent newCV) throws FieldException
    {
        newCV = AttributeDecoratorUtils.setValue (FIELD_CV_Decorators, (JobApplication)this, FIELD_CV, newCV);

        boolean oldAndNewIdentical = HELPER_CV.compare (_CV, newCV);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newCV = bhd.setCV ((JobApplication)this, newCV);
                oldAndNewIdentical = HELPER_CV.compare (_CV, newCV);
            }

            

            if (FIELD_CV_Validators.length > 0)
            {
                Object newCVObj = HELPER_CV.toObject (newCV);

                if (newCVObj != null)
                {
                    int     loopMax = FIELD_CV_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_CV);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_CV_Validators[v].checkAttribute (this, FIELD_CV, metadata, newCVObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_CV_Decorators, (JobApplication)this, FIELD_CV ,getWriteability_CV ()) != FieldWriteability.FALSE, "Field  CV is not writeable");
            preCVChange (newCV);
            markFieldChange (FIELD_CV);
            _CV = newCV;            
            postFieldChange (FIELD_CV);
            postCVChange ();
        }
    }

    /**
     * Attribute CoverLetter
     */
    public BinaryContent getCoverLetter ()
    {
        assertValid();
        BinaryContent valToReturn = AttributeDecoratorUtils.getValue (FIELD_CoverLetter_Decorators, (JobApplication)this, FIELD_CoverLetter, _CoverLetter);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getCoverLetter ((JobApplication)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 preCoverLetterChange (BinaryContent newCoverLetter) 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 postCoverLetterChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_CoverLetter ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute CoverLetter.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setCoverLetter (BinaryContent newCoverLetter) throws FieldException
    {
        newCoverLetter = AttributeDecoratorUtils.setValue (FIELD_CoverLetter_Decorators, (JobApplication)this, FIELD_CoverLetter, newCoverLetter);

        boolean oldAndNewIdentical = HELPER_CoverLetter.compare (_CoverLetter, newCoverLetter);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newCoverLetter = bhd.setCoverLetter ((JobApplication)this, newCoverLetter);
                oldAndNewIdentical = HELPER_CoverLetter.compare (_CoverLetter, newCoverLetter);
            }

            

            if (FIELD_CoverLetter_Validators.length > 0)
            {
                Object newCoverLetterObj = HELPER_CoverLetter.toObject (newCoverLetter);

                if (newCoverLetterObj != null)
                {
                    int     loopMax = FIELD_CoverLetter_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_CoverLetter);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_CoverLetter_Validators[v].checkAttribute (this, FIELD_CoverLetter, metadata, newCoverLetterObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_CoverLetter_Decorators, (JobApplication)this, FIELD_CoverLetter ,getWriteability_CoverLetter ()) != FieldWriteability.FALSE, "Field  CoverLetter is not writeable");
            preCoverLetterChange (newCoverLetter);
            markFieldChange (FIELD_CoverLetter);
            _CoverLetter = newCoverLetter;            
            postFieldChange (FIELD_CoverLetter);
            postCoverLetterChange ();
        }
    }

    /**
     * Attribute ApplicationStatus
     */
    public ApplicationStatus getApplicationStatus ()
    {
        assertValid();
        ApplicationStatus valToReturn = AttributeDecoratorUtils.getValue (FIELD_ApplicationStatus_Decorators, (JobApplication)this, FIELD_ApplicationStatus, _ApplicationStatus);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getApplicationStatus ((JobApplication)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 preApplicationStatusChange (ApplicationStatus newApplicationStatus) 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 postApplicationStatusChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_ApplicationStatus ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute ApplicationStatus.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setApplicationStatus (ApplicationStatus newApplicationStatus) throws FieldException
    {
        newApplicationStatus = AttributeDecoratorUtils.setValue (FIELD_ApplicationStatus_Decorators, (JobApplication)this, FIELD_ApplicationStatus, newApplicationStatus);

        boolean oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newApplicationStatus = bhd.setApplicationStatus ((JobApplication)this, newApplicationStatus);
                oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
            }

            BusinessObjectParser.assertFieldCondition (newApplicationStatus != null, this, FIELD_ApplicationStatus, "mandatory");
            

            if (FIELD_ApplicationStatus_Validators.length > 0)
            {
                Object newApplicationStatusObj = HELPER_ApplicationStatus.toObject (newApplicationStatus);

                if (newApplicationStatusObj != null)
                {
                    int     loopMax = FIELD_ApplicationStatus_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_ApplicationStatus);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_ApplicationStatus_Validators[v].checkAttribute (this, FIELD_ApplicationStatus, metadata, newApplicationStatusObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_ApplicationStatus_Decorators, (JobApplication)this, FIELD_ApplicationStatus ,getWriteability_ApplicationStatus ()) != FieldWriteability.FALSE, "Field  ApplicationStatus is not writeable");
            preApplicationStatusChange (newApplicationStatus);
            markFieldChange (FIELD_ApplicationStatus);
            _ApplicationStatus = newApplicationStatus;            
            postFieldChange (FIELD_ApplicationStatus);
            postApplicationStatusChange ();
        }
    }

    /**
     * Attribute SubmittedDate
     */
    public Date getSubmittedDate ()
    {
        assertValid();
        Date valToReturn = AttributeDecoratorUtils.getValue (FIELD_SubmittedDate_Decorators, (JobApplication)this, FIELD_SubmittedDate, _SubmittedDate);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getSubmittedDate ((JobApplication)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 preSubmittedDateChange (Date newSubmittedDate) 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 postSubmittedDateChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_SubmittedDate ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute SubmittedDate.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setSubmittedDate (Date newSubmittedDate) throws FieldException
    {
        newSubmittedDate = AttributeDecoratorUtils.setValue (FIELD_SubmittedDate_Decorators, (JobApplication)this, FIELD_SubmittedDate, newSubmittedDate);

        boolean oldAndNewIdentical = HELPER_SubmittedDate.compare (_SubmittedDate, newSubmittedDate);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newSubmittedDate = bhd.setSubmittedDate ((JobApplication)this, newSubmittedDate);
                oldAndNewIdentical = HELPER_SubmittedDate.compare (_SubmittedDate, newSubmittedDate);
            }

            

            if (FIELD_SubmittedDate_Validators.length > 0)
            {
                Object newSubmittedDateObj = HELPER_SubmittedDate.toObject (newSubmittedDate);

                if (newSubmittedDateObj != null)
                {
                    int     loopMax = FIELD_SubmittedDate_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_SubmittedDate);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_SubmittedDate_Validators[v].checkAttribute (this, FIELD_SubmittedDate, metadata, newSubmittedDateObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_SubmittedDate_Decorators, (JobApplication)this, FIELD_SubmittedDate ,getWriteability_SubmittedDate ()) != FieldWriteability.FALSE, "Field  SubmittedDate is not writeable");
            preSubmittedDateChange (newSubmittedDate);
            markFieldChange (FIELD_SubmittedDate);
            _SubmittedDate = newSubmittedDate;            
            postFieldChange (FIELD_SubmittedDate);
            postSubmittedDateChange ();
        }
    }

    /**
     * Attribute GoogleAddressText
     */
    public String getGoogleAddressText ()
    {
        assertValid();
        String valToReturn = AttributeDecoratorUtils.getValue (FIELD_GoogleAddressText_Decorators, (JobApplication)this, FIELD_GoogleAddressText, _GoogleAddressText);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getGoogleAddressText ((JobApplication)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 preGoogleAddressTextChange (String newGoogleAddressText) 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 postGoogleAddressTextChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_GoogleAddressText ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute GoogleAddressText.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setGoogleAddressText (String newGoogleAddressText) throws FieldException
    {
        newGoogleAddressText = AttributeDecoratorUtils.setValue (FIELD_GoogleAddressText_Decorators, (JobApplication)this, FIELD_GoogleAddressText, newGoogleAddressText);

        boolean oldAndNewIdentical = HELPER_GoogleAddressText.compare (_GoogleAddressText, newGoogleAddressText);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newGoogleAddressText = bhd.setGoogleAddressText ((JobApplication)this, newGoogleAddressText);
                oldAndNewIdentical = HELPER_GoogleAddressText.compare (_GoogleAddressText, newGoogleAddressText);
            }

            

            if (FIELD_GoogleAddressText_Validators.length > 0)
            {
                Object newGoogleAddressTextObj = HELPER_GoogleAddressText.toObject (newGoogleAddressText);

                if (newGoogleAddressTextObj != null)
                {
                    int     loopMax = FIELD_GoogleAddressText_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_GoogleAddressText);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_GoogleAddressText_Validators[v].checkAttribute (this, FIELD_GoogleAddressText, metadata, newGoogleAddressTextObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_GoogleAddressText_Decorators, (JobApplication)this, FIELD_GoogleAddressText ,getWriteability_GoogleAddressText ()) != FieldWriteability.FALSE, "Field  GoogleAddressText is not writeable");
            preGoogleAddressTextChange (newGoogleAddressText);
            markFieldChange (FIELD_GoogleAddressText);
            _GoogleAddressText = newGoogleAddressText;            
            postFieldChange (FIELD_GoogleAddressText);
            postGoogleAddressTextChange ();
        }
    }

    /**
     * Attribute PreferRemote
     */
    public Boolean getPreferRemote ()
    {
        assertValid();
        Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_PreferRemote_Decorators, (JobApplication)this, FIELD_PreferRemote, _PreferRemote);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getPreferRemote ((JobApplication)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 prePreferRemoteChange (Boolean newPreferRemote) 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 postPreferRemoteChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_PreferRemote ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute PreferRemote.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setPreferRemote (Boolean newPreferRemote) throws FieldException
    {
        newPreferRemote = AttributeDecoratorUtils.setValue (FIELD_PreferRemote_Decorators, (JobApplication)this, FIELD_PreferRemote, newPreferRemote);

        boolean oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newPreferRemote = bhd.setPreferRemote ((JobApplication)this, newPreferRemote);
                oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
            }

            

            if (FIELD_PreferRemote_Validators.length > 0)
            {
                Object newPreferRemoteObj = HELPER_PreferRemote.toObject (newPreferRemote);

                if (newPreferRemoteObj != null)
                {
                    int     loopMax = FIELD_PreferRemote_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_PreferRemote);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_PreferRemote_Validators[v].checkAttribute (this, FIELD_PreferRemote, metadata, newPreferRemoteObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_PreferRemote_Decorators, (JobApplication)this, FIELD_PreferRemote ,getWriteability_PreferRemote ()) != FieldWriteability.FALSE, "Field  PreferRemote is not writeable");
            prePreferRemoteChange (newPreferRemote);
            markFieldChange (FIELD_PreferRemote);
            _PreferRemote = newPreferRemote;            
            postFieldChange (FIELD_PreferRemote);
            postPreferRemoteChange ();
        }
    }

    /**
     * Attribute HappyToRelocate
     */
    public Boolean getHappyToRelocate ()
    {
        assertValid();
        Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_HappyToRelocate_Decorators, (JobApplication)this, FIELD_HappyToRelocate, _HappyToRelocate);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getHappyToRelocate ((JobApplication)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 preHappyToRelocateChange (Boolean newHappyToRelocate) 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 postHappyToRelocateChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_HappyToRelocate ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute HappyToRelocate.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setHappyToRelocate (Boolean newHappyToRelocate) throws FieldException
    {
        newHappyToRelocate = AttributeDecoratorUtils.setValue (FIELD_HappyToRelocate_Decorators, (JobApplication)this, FIELD_HappyToRelocate, newHappyToRelocate);

        boolean oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newHappyToRelocate = bhd.setHappyToRelocate ((JobApplication)this, newHappyToRelocate);
                oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
            }

            

            if (FIELD_HappyToRelocate_Validators.length > 0)
            {
                Object newHappyToRelocateObj = HELPER_HappyToRelocate.toObject (newHappyToRelocate);

                if (newHappyToRelocateObj != null)
                {
                    int     loopMax = FIELD_HappyToRelocate_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_HappyToRelocate);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_HappyToRelocate_Validators[v].checkAttribute (this, FIELD_HappyToRelocate, metadata, newHappyToRelocateObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_HappyToRelocate_Decorators, (JobApplication)this, FIELD_HappyToRelocate ,getWriteability_HappyToRelocate ()) != FieldWriteability.FALSE, "Field  HappyToRelocate is not writeable");
            preHappyToRelocateChange (newHappyToRelocate);
            markFieldChange (FIELD_HappyToRelocate);
            _HappyToRelocate = newHappyToRelocate;            
            postFieldChange (FIELD_HappyToRelocate);
            postHappyToRelocateChange ();
        }
    }

    /**
     * Attribute IsEmailIngest
     */
    public Boolean getIsEmailIngest ()
    {
        assertValid();
        Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_IsEmailIngest_Decorators, (JobApplication)this, FIELD_IsEmailIngest, _IsEmailIngest);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getIsEmailIngest ((JobApplication)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 preIsEmailIngestChange (Boolean newIsEmailIngest) 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 postIsEmailIngestChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_IsEmailIngest ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute IsEmailIngest.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setIsEmailIngest (Boolean newIsEmailIngest) throws FieldException
    {
        newIsEmailIngest = AttributeDecoratorUtils.setValue (FIELD_IsEmailIngest_Decorators, (JobApplication)this, FIELD_IsEmailIngest, newIsEmailIngest);

        boolean oldAndNewIdentical = HELPER_IsEmailIngest.compare (_IsEmailIngest, newIsEmailIngest);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newIsEmailIngest = bhd.setIsEmailIngest ((JobApplication)this, newIsEmailIngest);
                oldAndNewIdentical = HELPER_IsEmailIngest.compare (_IsEmailIngest, newIsEmailIngest);
            }

            

            if (FIELD_IsEmailIngest_Validators.length > 0)
            {
                Object newIsEmailIngestObj = HELPER_IsEmailIngest.toObject (newIsEmailIngest);

                if (newIsEmailIngestObj != null)
                {
                    int     loopMax = FIELD_IsEmailIngest_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_IsEmailIngest);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_IsEmailIngest_Validators[v].checkAttribute (this, FIELD_IsEmailIngest, metadata, newIsEmailIngestObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_IsEmailIngest_Decorators, (JobApplication)this, FIELD_IsEmailIngest ,getWriteability_IsEmailIngest ()) != FieldWriteability.FALSE, "Field  IsEmailIngest is not writeable");
            preIsEmailIngestChange (newIsEmailIngest);
            markFieldChange (FIELD_IsEmailIngest);
            _IsEmailIngest = newIsEmailIngest;            
            postFieldChange (FIELD_IsEmailIngest);
            postIsEmailIngestChange ();
        }
    }

    /**
     * Attribute ApplicantSource
     */
    public ApplicantSource getApplicantSource ()
    {
        assertValid();
        ApplicantSource valToReturn = AttributeDecoratorUtils.getValue (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource, _ApplicantSource);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getApplicantSource ((JobApplication)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 preApplicantSourceChange (ApplicantSource newApplicantSource) 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 postApplicantSourceChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_ApplicantSource ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute ApplicantSource.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setApplicantSource (ApplicantSource newApplicantSource) throws FieldException
    {
        newApplicantSource = AttributeDecoratorUtils.setValue (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource, newApplicantSource);

        boolean oldAndNewIdentical = HELPER_ApplicantSource.compare (_ApplicantSource, newApplicantSource);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newApplicantSource = bhd.setApplicantSource ((JobApplication)this, newApplicantSource);
                oldAndNewIdentical = HELPER_ApplicantSource.compare (_ApplicantSource, newApplicantSource);
            }

            

            if (FIELD_ApplicantSource_Validators.length > 0)
            {
                Object newApplicantSourceObj = HELPER_ApplicantSource.toObject (newApplicantSource);

                if (newApplicantSourceObj != null)
                {
                    int     loopMax = FIELD_ApplicantSource_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_ApplicantSource);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_ApplicantSource_Validators[v].checkAttribute (this, FIELD_ApplicantSource, metadata, newApplicantSourceObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource ,getWriteability_ApplicantSource ()) != FieldWriteability.FALSE, "Field  ApplicantSource is not writeable");
            preApplicantSourceChange (newApplicantSource);
            markFieldChange (FIELD_ApplicantSource);
            _ApplicantSource = newApplicantSource;            
            postFieldChange (FIELD_ApplicantSource);
            postApplicantSourceChange ();
        }
    }

    /**
     * Attribute AppProcessOption
     */
    public AppProcessOption getAppProcessOption ()
    {
        assertValid();
        AppProcessOption valToReturn = AttributeDecoratorUtils.getValue (FIELD_AppProcessOption_Decorators, (JobApplication)this, FIELD_AppProcessOption, _AppProcessOption);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getAppProcessOption ((JobApplication)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 preAppProcessOptionChange (AppProcessOption newAppProcessOption) 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 postAppProcessOptionChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_AppProcessOption ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute AppProcessOption.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setAppProcessOption (AppProcessOption newAppProcessOption) throws FieldException
    {
        newAppProcessOption = AttributeDecoratorUtils.setValue (FIELD_AppProcessOption_Decorators, (JobApplication)this, FIELD_AppProcessOption, newAppProcessOption);

        boolean oldAndNewIdentical = HELPER_AppProcessOption.compare (_AppProcessOption, newAppProcessOption);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newAppProcessOption = bhd.setAppProcessOption ((JobApplication)this, newAppProcessOption);
                oldAndNewIdentical = HELPER_AppProcessOption.compare (_AppProcessOption, newAppProcessOption);
            }

            

            if (FIELD_AppProcessOption_Validators.length > 0)
            {
                Object newAppProcessOptionObj = HELPER_AppProcessOption.toObject (newAppProcessOption);

                if (newAppProcessOptionObj != null)
                {
                    int     loopMax = FIELD_AppProcessOption_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_AppProcessOption);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_AppProcessOption_Validators[v].checkAttribute (this, FIELD_AppProcessOption, metadata, newAppProcessOptionObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_AppProcessOption_Decorators, (JobApplication)this, FIELD_AppProcessOption ,getWriteability_AppProcessOption ()) != FieldWriteability.FALSE, "Field  AppProcessOption is not writeable");
            preAppProcessOptionChange (newAppProcessOption);
            markFieldChange (FIELD_AppProcessOption);
            _AppProcessOption = newAppProcessOption;            
            postFieldChange (FIELD_AppProcessOption);
            postAppProcessOptionChange ();
        }
    }

    /**
     * Attribute OverallRank
     */
    public Integer getOverallRank ()
    {
        assertValid();
        Integer valToReturn = AttributeDecoratorUtils.getValue (FIELD_OverallRank_Decorators, (JobApplication)this, FIELD_OverallRank, _OverallRank);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getOverallRank ((JobApplication)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 preOverallRankChange (Integer newOverallRank) 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 postOverallRankChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_OverallRank ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute OverallRank.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setOverallRank (Integer newOverallRank) throws FieldException
    {
        newOverallRank = AttributeDecoratorUtils.setValue (FIELD_OverallRank_Decorators, (JobApplication)this, FIELD_OverallRank, newOverallRank);

        boolean oldAndNewIdentical = HELPER_OverallRank.compare (_OverallRank, newOverallRank);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newOverallRank = bhd.setOverallRank ((JobApplication)this, newOverallRank);
                oldAndNewIdentical = HELPER_OverallRank.compare (_OverallRank, newOverallRank);
            }

            

            if (FIELD_OverallRank_Validators.length > 0)
            {
                Object newOverallRankObj = HELPER_OverallRank.toObject (newOverallRank);

                if (newOverallRankObj != null)
                {
                    int     loopMax = FIELD_OverallRank_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_OverallRank);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_OverallRank_Validators[v].checkAttribute (this, FIELD_OverallRank, metadata, newOverallRankObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_OverallRank_Decorators, (JobApplication)this, FIELD_OverallRank ,getWriteability_OverallRank ()) != FieldWriteability.FALSE, "Field  OverallRank is not writeable");
            preOverallRankChange (newOverallRank);
            markFieldChange (FIELD_OverallRank);
            _OverallRank = newOverallRank;            
            postFieldChange (FIELD_OverallRank);
            postOverallRankChange ();
        }
    }

    /**
     * Attribute RoleFit
     */
    public Map getRoleFit ()
    {
        assertValid();
        Map valToReturn = AttributeDecoratorUtils.getValue (FIELD_RoleFit_Decorators, (JobApplication)this, FIELD_RoleFit, _RoleFit);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getRoleFit ((JobApplication)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 preRoleFitChange (Map newRoleFit) 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 postRoleFitChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_RoleFit ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute RoleFit.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setRoleFit (Map newRoleFit) throws FieldException
    {
        newRoleFit = AttributeDecoratorUtils.setValue (FIELD_RoleFit_Decorators, (JobApplication)this, FIELD_RoleFit, newRoleFit);

        boolean oldAndNewIdentical = HELPER_RoleFit.compare (_RoleFit, newRoleFit);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newRoleFit = bhd.setRoleFit ((JobApplication)this, newRoleFit);
                oldAndNewIdentical = HELPER_RoleFit.compare (_RoleFit, newRoleFit);
            }

            

            if (FIELD_RoleFit_Validators.length > 0)
            {
                Object newRoleFitObj = HELPER_RoleFit.toObject (newRoleFit);

                if (newRoleFitObj != null)
                {
                    int     loopMax = FIELD_RoleFit_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_RoleFit);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_RoleFit_Validators[v].checkAttribute (this, FIELD_RoleFit, metadata, newRoleFitObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_RoleFit_Decorators, (JobApplication)this, FIELD_RoleFit ,getWriteability_RoleFit ()) != FieldWriteability.FALSE, "Field  RoleFit is not writeable");
            preRoleFitChange (newRoleFit);
            markFieldChange (FIELD_RoleFit);
            _RoleFit = newRoleFit;            
            postFieldChange (FIELD_RoleFit);
            postRoleFitChange ();
        }
    }

    /**
     * Attribute RequirementFit
     */
    public Map getRequirementFit ()
    {
        assertValid();
        Map valToReturn = AttributeDecoratorUtils.getValue (FIELD_RequirementFit_Decorators, (JobApplication)this, FIELD_RequirementFit, _RequirementFit);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getRequirementFit ((JobApplication)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 preRequirementFitChange (Map newRequirementFit) 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 postRequirementFitChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_RequirementFit ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute RequirementFit.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setRequirementFit (Map newRequirementFit) throws FieldException
    {
        newRequirementFit = AttributeDecoratorUtils.setValue (FIELD_RequirementFit_Decorators, (JobApplication)this, FIELD_RequirementFit, newRequirementFit);

        boolean oldAndNewIdentical = HELPER_RequirementFit.compare (_RequirementFit, newRequirementFit);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newRequirementFit = bhd.setRequirementFit ((JobApplication)this, newRequirementFit);
                oldAndNewIdentical = HELPER_RequirementFit.compare (_RequirementFit, newRequirementFit);
            }

            

            if (FIELD_RequirementFit_Validators.length > 0)
            {
                Object newRequirementFitObj = HELPER_RequirementFit.toObject (newRequirementFit);

                if (newRequirementFitObj != null)
                {
                    int     loopMax = FIELD_RequirementFit_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_RequirementFit);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_RequirementFit_Validators[v].checkAttribute (this, FIELD_RequirementFit, metadata, newRequirementFitObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_RequirementFit_Decorators, (JobApplication)this, FIELD_RequirementFit ,getWriteability_RequirementFit ()) != FieldWriteability.FALSE, "Field  RequirementFit is not writeable");
            preRequirementFitChange (newRequirementFit);
            markFieldChange (FIELD_RequirementFit);
            _RequirementFit = newRequirementFit;            
            postFieldChange (FIELD_RequirementFit);
            postRequirementFitChange ();
        }
    }

    /**
     * Attribute CultureFit
     */
    public Map getCultureFit ()
    {
        assertValid();
        Map valToReturn = AttributeDecoratorUtils.getValue (FIELD_CultureFit_Decorators, (JobApplication)this, FIELD_CultureFit, _CultureFit);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getCultureFit ((JobApplication)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 preCultureFitChange (Map newCultureFit) 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 postCultureFitChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_CultureFit ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute CultureFit.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setCultureFit (Map newCultureFit) throws FieldException
    {
        newCultureFit = AttributeDecoratorUtils.setValue (FIELD_CultureFit_Decorators, (JobApplication)this, FIELD_CultureFit, newCultureFit);

        boolean oldAndNewIdentical = HELPER_CultureFit.compare (_CultureFit, newCultureFit);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newCultureFit = bhd.setCultureFit ((JobApplication)this, newCultureFit);
                oldAndNewIdentical = HELPER_CultureFit.compare (_CultureFit, newCultureFit);
            }

            

            if (FIELD_CultureFit_Validators.length > 0)
            {
                Object newCultureFitObj = HELPER_CultureFit.toObject (newCultureFit);

                if (newCultureFitObj != null)
                {
                    int     loopMax = FIELD_CultureFit_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_CultureFit);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_CultureFit_Validators[v].checkAttribute (this, FIELD_CultureFit, metadata, newCultureFitObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_CultureFit_Decorators, (JobApplication)this, FIELD_CultureFit ,getWriteability_CultureFit ()) != FieldWriteability.FALSE, "Field  CultureFit is not writeable");
            preCultureFitChange (newCultureFit);
            markFieldChange (FIELD_CultureFit);
            _CultureFit = newCultureFit;            
            postFieldChange (FIELD_CultureFit);
            postCultureFitChange ();
        }
    }

    /**
     * Attribute FactorScoreDetails
     */
    public Map getFactorScoreDetails ()
    {
        assertValid();
        Map valToReturn = AttributeDecoratorUtils.getValue (FIELD_FactorScoreDetails_Decorators, (JobApplication)this, FIELD_FactorScoreDetails, _FactorScoreDetails);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getFactorScoreDetails ((JobApplication)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 preFactorScoreDetailsChange (Map newFactorScoreDetails) 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 postFactorScoreDetailsChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_FactorScoreDetails ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute FactorScoreDetails.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setFactorScoreDetails (Map newFactorScoreDetails) throws FieldException
    {
        newFactorScoreDetails = AttributeDecoratorUtils.setValue (FIELD_FactorScoreDetails_Decorators, (JobApplication)this, FIELD_FactorScoreDetails, newFactorScoreDetails);

        boolean oldAndNewIdentical = HELPER_FactorScoreDetails.compare (_FactorScoreDetails, newFactorScoreDetails);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newFactorScoreDetails = bhd.setFactorScoreDetails ((JobApplication)this, newFactorScoreDetails);
                oldAndNewIdentical = HELPER_FactorScoreDetails.compare (_FactorScoreDetails, newFactorScoreDetails);
            }

            

            if (FIELD_FactorScoreDetails_Validators.length > 0)
            {
                Object newFactorScoreDetailsObj = HELPER_FactorScoreDetails.toObject (newFactorScoreDetails);

                if (newFactorScoreDetailsObj != null)
                {
                    int     loopMax = FIELD_FactorScoreDetails_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_FactorScoreDetails);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_FactorScoreDetails_Validators[v].checkAttribute (this, FIELD_FactorScoreDetails, metadata, newFactorScoreDetailsObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_FactorScoreDetails_Decorators, (JobApplication)this, FIELD_FactorScoreDetails ,getWriteability_FactorScoreDetails ()) != FieldWriteability.FALSE, "Field  FactorScoreDetails is not writeable");
            preFactorScoreDetailsChange (newFactorScoreDetails);
            markFieldChange (FIELD_FactorScoreDetails);
            _FactorScoreDetails = newFactorScoreDetails;            
            postFieldChange (FIELD_FactorScoreDetails);
            postFactorScoreDetailsChange ();
        }
    }

    /**
     * Attribute Note
     */
    public String getNote ()
    {
        assertValid();
        String valToReturn = AttributeDecoratorUtils.getValue (FIELD_Note_Decorators, (JobApplication)this, FIELD_Note, _Note);

        
        for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
        {
            valToReturn = bhd.getNote ((JobApplication)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 preNoteChange (String newNote) 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 postNoteChange () throws FieldException
    {
    }

    
    public FieldWriteability getWriteability_Note ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

    /**
     * Set the attribute Note.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setNote (String newNote) throws FieldException
    {
        newNote = AttributeDecoratorUtils.setValue (FIELD_Note_Decorators, (JobApplication)this, FIELD_Note, newNote);

        boolean oldAndNewIdentical = HELPER_Note.compare (_Note, newNote);
        
        try
        {
            for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
            {
                newNote = bhd.setNote ((JobApplication)this, newNote);
                oldAndNewIdentical = HELPER_Note.compare (_Note, newNote);
            }

            

            if (FIELD_Note_Validators.length > 0)
            {
                Object newNoteObj = HELPER_Note.toObject (newNote);

                if (newNoteObj != null)
                {
                    int     loopMax = FIELD_Note_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_Note);

                    for (int v = 0 ; v < loopMax ; ++v)
                    {
                        FIELD_Note_Validators[v].checkAttribute (this, FIELD_Note, metadata, newNoteObj);
                    }
                }
            }
        }
        catch (FieldException e)
        {
            if (!oldAndNewIdentical)
            {
                e.setWouldModify ();
            }
            
            throw e;
        }

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_Note_Decorators, (JobApplication)this, FIELD_Note ,getWriteability_Note ()) != FieldWriteability.FALSE, "Field  Note is not writeable");
            preNoteChange (newNote);
            markFieldChange (FIELD_Note);
            _Note = newNote;            
            postFieldChange (FIELD_Note);
            postNoteChange ();
        }
    }



    /**
     * A list of multi assoc names e.g. list of strings.
     */
    public List<String> getSingleAssocs()
    {
        List result = super.getSingleAssocs ();
        
        result.add("Candidate");
        result.add("Job");
        result.add("WorkFlowStage");

        return result;
    }
    
    
    public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        else if (assocName.equals (SINGLEREFERENCE_Candidate))
        {
            return _Candidate.getReferencedType ();
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            return _Job.getReferencedType ();
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return _WorkFlowStage.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_Candidate))
        {
            return Candidate.MULTIPLEREFERENCE_JobApplications ;
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            return Job.MULTIPLEREFERENCE_JobApplications ;
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return null ;
        }
        else
        {
            return super.getSingleAssocBackReference (assocName);
        }
    }
    
    
    public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        else if (assocName.equals (SINGLEREFERENCE_Candidate))
        {
            return getCandidate ();
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            return getJob ();
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return getWorkFlowStage ();
        }
        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_Candidate))
        {
            return getCandidate (getType);
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            return getJob (getType);
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return getWorkFlowStage (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_Candidate))
        {
            return getCandidateID ();
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            return getJobID ();
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return getWorkFlowStageID ();
        }
        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_Candidate))
        {
            setCandidate ((Candidate)(newValue));
        }
        else if (assocName.equals (SINGLEREFERENCE_Job))
        {
            setJob ((Job)(newValue));
        }
        else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            setWorkFlowStage ((WorkFlowStage)(newValue));
        }
        else
        {
            super.setSingleAssoc (assocName, newValue);
        }
    }



    /**
     * Get the reference Candidate
     */
    public Candidate getCandidate () throws StorageException
    {
        assertValid();
        
        try
        {
            return (Candidate)(_Candidate.get ());
        }
        catch (ClassCastException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in JobApplication:", this.getObjectID (), ", was trying to get Candidate:",  getCandidateID ());
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Candidate.get ().getClass ());
            throw e;
        }
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Candidate getCandidate (Get getType) throws StorageException
    {
        assertValid();
        return _Candidate.get(getType);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getCandidateID ()
    {
        assertValid();
        
        if (_Candidate == null)
        {
            return null;
        }
        else
        {
            return _Candidate.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 preCandidateChange (Candidate newCandidate) 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 postCandidateChange () throws FieldException
    {
    }


    
    public FieldWriteability getWriteability_Candidate ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

        
    /**
     * Set the reference Candidate.  Checks to ensure a new value
     * has been supplied.  If so, marks the reference as altered and sets it.
     */
    public void setCandidate (Candidate newCandidate) throws StorageException, FieldException
    {
        BusinessObjectParser.assertFieldCondition (newCandidate != null, this, SINGLEREFERENCE_Candidate, "mandatory");

        if (_Candidate.wouldReferencedChange (newCandidate))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (SINGLEREFERENCE_Candidate_Decorators, (JobApplication)this, SINGLEREFERENCE_Candidate ,getWriteability_Candidate ()) != FieldWriteability.FALSE, "Assoc Candidate is not writeable");
            preCandidateChange (newCandidate);
            Candidate oldCandidate = getCandidate ();

            if (oldCandidate != null)
            {
                // This is to stop validation from triggering when we are removed
                _Candidate.set (null);
                oldCandidate.removeFromJobApplications ((JobApplication)(this));
            }

            _Candidate.set (newCandidate);

            if (newCandidate != null)
            {
                newCandidate.addToJobApplications ((JobApplication)(this));
            }
                
            postCandidateChange ();
        }
    }

    /**
     * Get the reference Job
     */
    public Job getJob () throws StorageException
    {
        assertValid();
        
        try
        {
            return (Job)(_Job.get ());
        }
        catch (ClassCastException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in JobApplication:", this.getObjectID (), ", was trying to get Job:",  getJobID ());
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Job.get ().getClass ());
            throw e;
        }
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Job getJob (Get getType) throws StorageException
    {
        assertValid();
        return _Job.get(getType);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getJobID ()
    {
        assertValid();
        
        if (_Job == null)
        {
            return null;
        }
        else
        {
            return _Job.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 preJobChange (Job newJob) 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 postJobChange () throws FieldException
    {
    }


    
    public FieldWriteability getWriteability_Job ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

        
    /**
     * Set the reference Job.  Checks to ensure a new value
     * has been supplied.  If so, marks the reference as altered and sets it.
     */
    public void setJob (Job newJob) throws StorageException, FieldException
    {
        BusinessObjectParser.assertFieldCondition (newJob != null, this, SINGLEREFERENCE_Job, "mandatory");

        if (_Job.wouldReferencedChange (newJob))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (SINGLEREFERENCE_Job_Decorators, (JobApplication)this, SINGLEREFERENCE_Job ,getWriteability_Job ()) != FieldWriteability.FALSE, "Assoc Job is not writeable");
            preJobChange (newJob);
            Job oldJob = getJob ();

            if (oldJob != null)
            {
                // This is to stop validation from triggering when we are removed
                _Job.set (null);
                oldJob.removeFromJobApplications ((JobApplication)(this));
            }

            _Job.set (newJob);

            if (newJob != null)
            {
                newJob.addToJobApplications ((JobApplication)(this));
            }
                
            postJobChange ();
        }
    }

    /**
     * Get the reference WorkFlowStage
     */
    public WorkFlowStage getWorkFlowStage () throws StorageException
    {
        assertValid();
        
        try
        {
            return (WorkFlowStage)(_WorkFlowStage.get ());
        }
        catch (ClassCastException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in JobApplication:", this.getObjectID (), ", was trying to get WorkFlowStage:",  getWorkFlowStageID ());
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _WorkFlowStage.get ().getClass ());
            throw e;
        }
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public WorkFlowStage getWorkFlowStage (Get getType) throws StorageException
    {
        assertValid();
        return _WorkFlowStage.get(getType);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getWorkFlowStageID ()
    {
        assertValid();
        
        if (_WorkFlowStage == null)
        {
            return null;
        }
        else
        {
            return _WorkFlowStage.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 preWorkFlowStageChange (WorkFlowStage newWorkFlowStage) 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 postWorkFlowStageChange () throws FieldException
    {
    }


    
    public FieldWriteability getWriteability_WorkFlowStage ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }

        
    /**
     * Set the reference WorkFlowStage.  Checks to ensure a new value
     * has been supplied.  If so, marks the reference as altered and sets it.
     */
    public void setWorkFlowStage (WorkFlowStage newWorkFlowStage) throws StorageException, FieldException
    {
        if (_WorkFlowStage.wouldReferencedChange (newWorkFlowStage))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (SINGLEREFERENCE_WorkFlowStage_Decorators, (JobApplication)this, SINGLEREFERENCE_WorkFlowStage ,getWriteability_WorkFlowStage ()) != FieldWriteability.FALSE, "Assoc WorkFlowStage is not writeable");
            preWorkFlowStageChange (newWorkFlowStage);
            
            _WorkFlowStage.set (newWorkFlowStage);
                
            postWorkFlowStageChange ();
        }
    }

    /**
     * A list of multi assoc names e.g. list of strings.
     */
    public List<String> getMultiAssocs()
    {
        List result = super.getMultiAssocs ();
        
        result.add("AssessmentCriteriaAnswers");
        result.add("Notes");
        result.add("ScheduledEmails");
        result.add("SentEmails");
        result.add("Messages");

        return result;
    }


    /**
     * Get the reference instance for the multi assoc name.
     */
    public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            return AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer ;
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            return Note.REFERENCE_Note ;
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            return ScheduledEmail.REFERENCE_ScheduledEmail ;
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            return SentEmail.REFERENCE_SentEmail ;
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            return Message.REFERENCE_Message ;
        }

        return super.getMultiAssocReferenceInstance(attribName);
    }


    public String getMultiAssocBackReference(String attribName)
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            return AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication ;
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            return Note.SINGLEREFERENCE_JobApplication ;
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            return ScheduledEmail.SINGLEREFERENCE_JobApplication ;
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            return SentEmail.SINGLEREFERENCE_JobApplication ;
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            return Message.SINGLEREFERENCE_JobApplication ;
        }

        return super.getMultiAssocBackReference(attribName);
    }


    /**
     * Get the assoc count for the multi assoc name.
     */
    public int getMultiAssocCount(String attribName) throws StorageException
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            return this.getAssessmentCriteriaAnswersCount();
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            return this.getNotesCount();
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            return this.getScheduledEmailsCount();
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            return this.getSentEmailsCount();
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            return this.getMessagesCount();
        }

        return super.getMultiAssocCount(attribName);
    }


    /**
     * Get the assoc at a particular index
     */
    public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            return this.getAssessmentCriteriaAnswersAt(index);
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            return this.getNotesAt(index);
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            return this.getScheduledEmailsAt(index);
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            return this.getSentEmailsAt(index);
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            return this.getMessagesAt(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_AssessmentCriteriaAnswers.equals(attribName))
        {
            addToAssessmentCriteriaAnswers((AssessmentCriteriaAnswer)newElement);
            return;
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            addToNotes((Note)newElement);
            return;
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            addToScheduledEmails((ScheduledEmail)newElement);
            return;
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            addToSentEmails((SentEmail)newElement);
            return;
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            addToMessages((Message)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_AssessmentCriteriaAnswers.equals(attribName))
        {
            removeFromAssessmentCriteriaAnswers((AssessmentCriteriaAnswer)oldElement);
            return;
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            removeFromNotes((Note)oldElement);
            return;
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            removeFromScheduledEmails((ScheduledEmail)oldElement);
            return;
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            removeFromSentEmails((SentEmail)oldElement);
            return;
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            removeFromMessages((Message)oldElement);
            return;
        }

        super.removeFromMultiAssoc(attribName, oldElement);
    }


    protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            _AssessmentCriteriaAnswers.__loadAssociation (elements);
            return;
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            _Notes.__loadAssociation (elements);
            return;
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            _ScheduledEmails.__loadAssociation (elements);
            return;
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            _SentEmails.__loadAssociation (elements);
            return;
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            _Messages.__loadAssociation (elements);
            return;
        }

        super.__loadMultiAssoc(attribName, elements);
    }


    protected boolean __isMultiAssocLoaded (String attribName)
    {
        if (MULTIPLEREFERENCE_AssessmentCriteriaAnswers.equals(attribName))
        {
            return _AssessmentCriteriaAnswers.isLoaded ();
        }
        if (MULTIPLEREFERENCE_Notes.equals(attribName))
        {
            return _Notes.isLoaded ();
        }
        if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
        {
            return _ScheduledEmails.isLoaded ();
        }
        if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
        {
            return _SentEmails.isLoaded ();
        }
        if (MULTIPLEREFERENCE_Messages.equals(attribName))
        {
            return _Messages.isLoaded ();
        }

        return super.__isMultiAssocLoaded(attribName);
    }


    public FieldWriteability getWriteability_AssessmentCriteriaAnswers ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    public int getAssessmentCriteriaAnswersCount () throws StorageException
    {
        assertValid();
        return _AssessmentCriteriaAnswers.getReferencedObjectsCount ();
    }


    public void addToAssessmentCriteriaAnswers (AssessmentCriteriaAnswer newElement) throws StorageException
    {
        if (_AssessmentCriteriaAnswers.wouldAddChange (newElement))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_AssessmentCriteriaAnswers_Decorators, (JobApplication)this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers ,getWriteability_AssessmentCriteriaAnswers ()) != FieldWriteability.FALSE, "MultiAssoc AssessmentCriteriaAnswers is not writeable (add)");
            _AssessmentCriteriaAnswers.appendElement (newElement);

            try
            {
                if (newElement.getJobApplication () != this)
                {
                    newElement.setJobApplication ((JobApplication)(this));
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public void removeFromAssessmentCriteriaAnswers (AssessmentCriteriaAnswer elementToRemove) throws StorageException
    {
        if (_AssessmentCriteriaAnswers.wouldRemoveChange (elementToRemove))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_AssessmentCriteriaAnswers_Decorators, (JobApplication)this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers ,getWriteability_AssessmentCriteriaAnswers ()) != FieldWriteability.FALSE, "MultiAssoc AssessmentCriteriaAnswers is not writeable (remove)");
            _AssessmentCriteriaAnswers.removeElement (elementToRemove);
            try
            {
                if (elementToRemove.getJobApplication () != null)
                {
                    elementToRemove.setJobApplication (null);
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public AssessmentCriteriaAnswer getAssessmentCriteriaAnswersAt (int index) throws StorageException
    {
        return (AssessmentCriteriaAnswer)(_AssessmentCriteriaAnswers.getElementAt (index));
    }


    public SortedSet<AssessmentCriteriaAnswer> getAssessmentCriteriaAnswersSet () throws StorageException
    {
        return _AssessmentCriteriaAnswers.getSet ();
    }

    public FieldWriteability getWriteability_Notes ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    public int getNotesCount () throws StorageException
    {
        assertValid();
        return _Notes.getReferencedObjectsCount ();
    }


    public void addToNotes (Note newElement) throws StorageException
    {
        if (_Notes.wouldAddChange (newElement))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Notes_Decorators, (JobApplication)this, MULTIPLEREFERENCE_Notes ,getWriteability_Notes ()) != FieldWriteability.FALSE, "MultiAssoc Notes is not writeable (add)");
            _Notes.appendElement (newElement);

            try
            {
                if (newElement.getJobApplication () != this)
                {
                    newElement.setJobApplication ((JobApplication)(this));
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public void removeFromNotes (Note elementToRemove) throws StorageException
    {
        if (_Notes.wouldRemoveChange (elementToRemove))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Notes_Decorators, (JobApplication)this, MULTIPLEREFERENCE_Notes ,getWriteability_Notes ()) != FieldWriteability.FALSE, "MultiAssoc Notes is not writeable (remove)");
            _Notes.removeElement (elementToRemove);
            try
            {
                if (elementToRemove.getJobApplication () != null)
                {
                    elementToRemove.setJobApplication (null);
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public Note getNotesAt (int index) throws StorageException
    {
        return (Note)(_Notes.getElementAt (index));
    }


    public SortedSet<Note> getNotesSet () throws StorageException
    {
        return _Notes.getSet ();
    }

    public FieldWriteability getWriteability_ScheduledEmails ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    public int getScheduledEmailsCount () throws StorageException
    {
        assertValid();
        return _ScheduledEmails.getReferencedObjectsCount ();
    }


    public void addToScheduledEmails (ScheduledEmail newElement) throws StorageException
    {
        if (_ScheduledEmails.wouldAddChange (newElement))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_ScheduledEmails_Decorators, (JobApplication)this, MULTIPLEREFERENCE_ScheduledEmails ,getWriteability_ScheduledEmails ()) != FieldWriteability.FALSE, "MultiAssoc ScheduledEmails is not writeable (add)");
            _ScheduledEmails.appendElement (newElement);

            try
            {
                if (newElement.getJobApplication () != this)
                {
                    newElement.setJobApplication ((JobApplication)(this));
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public void removeFromScheduledEmails (ScheduledEmail elementToRemove) throws StorageException
    {
        if (_ScheduledEmails.wouldRemoveChange (elementToRemove))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_ScheduledEmails_Decorators, (JobApplication)this, MULTIPLEREFERENCE_ScheduledEmails ,getWriteability_ScheduledEmails ()) != FieldWriteability.FALSE, "MultiAssoc ScheduledEmails is not writeable (remove)");
            _ScheduledEmails.removeElement (elementToRemove);
            try
            {
                if (elementToRemove.getJobApplication () != null)
                {
                    elementToRemove.setJobApplication (null);
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public ScheduledEmail getScheduledEmailsAt (int index) throws StorageException
    {
        return (ScheduledEmail)(_ScheduledEmails.getElementAt (index));
    }


    public SortedSet<ScheduledEmail> getScheduledEmailsSet () throws StorageException
    {
        return _ScheduledEmails.getSet ();
    }

    public FieldWriteability getWriteability_SentEmails ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    public int getSentEmailsCount () throws StorageException
    {
        assertValid();
        return _SentEmails.getReferencedObjectsCount ();
    }


    public void addToSentEmails (SentEmail newElement) throws StorageException
    {
        if (_SentEmails.wouldAddChange (newElement))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_SentEmails_Decorators, (JobApplication)this, MULTIPLEREFERENCE_SentEmails ,getWriteability_SentEmails ()) != FieldWriteability.FALSE, "MultiAssoc SentEmails is not writeable (add)");
            _SentEmails.appendElement (newElement);

            try
            {
                if (newElement.getJobApplication () != this)
                {
                    newElement.setJobApplication ((JobApplication)(this));
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public void removeFromSentEmails (SentEmail elementToRemove) throws StorageException
    {
        if (_SentEmails.wouldRemoveChange (elementToRemove))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_SentEmails_Decorators, (JobApplication)this, MULTIPLEREFERENCE_SentEmails ,getWriteability_SentEmails ()) != FieldWriteability.FALSE, "MultiAssoc SentEmails is not writeable (remove)");
            _SentEmails.removeElement (elementToRemove);
            try
            {
                if (elementToRemove.getJobApplication () != null)
                {
                    elementToRemove.setJobApplication (null);
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public SentEmail getSentEmailsAt (int index) throws StorageException
    {
        return (SentEmail)(_SentEmails.getElementAt (index));
    }


    public SortedSet<SentEmail> getSentEmailsSet () throws StorageException
    {
        return _SentEmails.getSet ();
    }

    public FieldWriteability getWriteability_Messages ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    public int getMessagesCount () throws StorageException
    {
        assertValid();
        return _Messages.getReferencedObjectsCount ();
    }


    public void addToMessages (Message newElement) throws StorageException
    {
        if (_Messages.wouldAddChange (newElement))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Messages_Decorators, (JobApplication)this, MULTIPLEREFERENCE_Messages ,getWriteability_Messages ()) != FieldWriteability.FALSE, "MultiAssoc Messages is not writeable (add)");
            _Messages.appendElement (newElement);

            try
            {
                if (newElement.getJobApplication () != this)
                {
                    newElement.setJobApplication ((JobApplication)(this));
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public void removeFromMessages (Message elementToRemove) throws StorageException
    {
        if (_Messages.wouldRemoveChange (elementToRemove))
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Messages_Decorators, (JobApplication)this, MULTIPLEREFERENCE_Messages ,getWriteability_Messages ()) != FieldWriteability.FALSE, "MultiAssoc Messages is not writeable (remove)");
            _Messages.removeElement (elementToRemove);
            try
            {
                if (elementToRemove.getJobApplication () != null)
                {
                    elementToRemove.setJobApplication (null);
                }
            }
            catch (Exception e)
            {
                throw NestedException.wrap(e);
            }
        }
    }


    public Message getMessagesAt (int index) throws StorageException
    {
        return (Message)(_Messages.getElementAt (index));
    }


    public SortedSet<Message> getMessagesSet () throws StorageException
    {
        return _Messages.getSet ();
    }



    public void onDelete ()
    {
        try 
        {
            // Ensure we are removed from any loaded multi-associations that aren't mandatory
            if (_Candidate.isLoaded () || getTransaction ().isObjectLoaded (_Candidate.getReferencedType (), getCandidateID ()))
            {
                Candidate  referenced = getCandidate ();

                if (referenced != null)
                {
                    // Stop the callback
                    LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplications from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Candidate.set (null);
                    referenced.removeFromJobApplications ((JobApplication)this);
                }
            }
        
            // Ensure we are removed from any loaded multi-associations that aren't mandatory
            if (_Job.isLoaded () || getTransaction ().isObjectLoaded (_Job.getReferencedType (), getJobID ()))
            {
                Job  referenced = getJob ();

                if (referenced != null)
                {
                    // Stop the callback
                    LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplications from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Job.set (null);
                    referenced.removeFromJobApplications ((JobApplication)this);
                }
            }
        
            for(AssessmentCriteriaAnswer referenced : CollectionUtils.reverse(getAssessmentCriteriaAnswersSet()))
            { 
                LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
                referenced.setJobApplication(null);
            }

            for(Note referenced : CollectionUtils.reverse(getNotesSet()))
            { 
                LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
                referenced.setJobApplication(null);
            }

            for(ScheduledEmail referenced : CollectionUtils.reverse(getScheduledEmailsSet()))
            { 
                LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
                referenced.setJobApplication(null);
            }

            for(SentEmail referenced : CollectionUtils.reverse(getSentEmailsSet()))
            { 
                LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
                referenced.setJobApplication(null);
            }

            for(Message referenced : CollectionUtils.reverse(getMessagesSet()))
            { 
                LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
                referenced.setJobApplication(null);
            }

        }
        catch (Exception e)
        {
            throw NestedException.wrap(e);
        }

        super.onDelete ();
    }


    public JobApplication newInstance ()
    {
        return new JobApplication ();
    }


    public JobApplication referenceInstance ()
    {
        return REFERENCE_JobApplication;
    }


    public JobApplication getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getJobApplicationByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_JobApplication;
    }


    public String getBaseSetName ()
    {
        return "tl_job_application";
    }



    /**
     * This is where an object returns the Persistent sets that will
     * store it into the database.
     * The should be entered into allSets
     */
    public void getPersistentSets (PersistentSetCollection allSets)
    {
        ObjectStatus        myStatus = getStatus ();
        PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
        ObjectID            myID = getID();

        super.getPersistentSets (allSets);
        
        PersistentSet   tl_job_applicationPSet = allSets.getPersistentSet (myID, "tl_job_application", myPSetStatus);

        tl_job_applicationPSet.setAttrib (FIELD_ObjectID, myID);
        tl_job_applicationPSet.setAttrib (FIELD_CV, HELPER_CV.toObject (_CV)); //
        tl_job_applicationPSet.setAttrib (FIELD_CoverLetter, HELPER_CoverLetter.toObject (_CoverLetter)); //
        tl_job_applicationPSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
        tl_job_applicationPSet.setAttrib (FIELD_SubmittedDate, HELPER_SubmittedDate.toObject (_SubmittedDate)); //
        tl_job_applicationPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
        tl_job_applicationPSet.setAttrib (FIELD_PreferRemote, HELPER_PreferRemote.toObject (_PreferRemote)); //
        tl_job_applicationPSet.setAttrib (FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject (_HappyToRelocate)); //
        tl_job_applicationPSet.setAttrib (FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject (_IsEmailIngest)); //
        tl_job_applicationPSet.setAttrib (FIELD_ApplicantSource, HELPER_ApplicantSource.toObject (_ApplicantSource)); //
        _Candidate.getPersistentSets (allSets);
        _Job.getPersistentSets (allSets);
        _WorkFlowStage.getPersistentSets (allSets);
        
    }


    /**
     * Sets the objects state based on Persistent sets.
     */
    public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
    {
        super.setFromPersistentSets (objectID, allSets);
        
        PersistentSet   tl_job_applicationPSet = allSets.getPersistentSet (objectID, "tl_job_application");

        _CV = (BinaryContent)(HELPER_CV.fromObject (_CV, tl_job_applicationPSet.getAttrib (FIELD_CV))); //
        _CoverLetter = (BinaryContent)(HELPER_CoverLetter.fromObject (_CoverLetter, tl_job_applicationPSet.getAttrib (FIELD_CoverLetter))); //
        _ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_job_applicationPSet.getAttrib (FIELD_ApplicationStatus))); //
        _SubmittedDate = (Date)(HELPER_SubmittedDate.fromObject (_SubmittedDate, tl_job_applicationPSet.getAttrib (FIELD_SubmittedDate))); //
        _GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, tl_job_applicationPSet.getAttrib (FIELD_GoogleAddressText))); //
        _PreferRemote = (Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, tl_job_applicationPSet.getAttrib (FIELD_PreferRemote))); //
        _HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, tl_job_applicationPSet.getAttrib (FIELD_HappyToRelocate))); //
        _IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, tl_job_applicationPSet.getAttrib (FIELD_IsEmailIngest))); //
        _ApplicantSource = (ApplicantSource)(HELPER_ApplicantSource.fromObject (_ApplicantSource, tl_job_applicationPSet.getAttrib (FIELD_ApplicantSource))); //
        _Candidate.setFromPersistentSets (objectID, allSets);
        _Job.setFromPersistentSets (objectID, allSets);
        _WorkFlowStage.setFromPersistentSets (objectID, allSets);
        
    }


    public void setAttributesFrom (BaseBusinessClass other, MultiException e)
    {
        super.setAttributesFrom (other, e);

        if (other instanceof JobApplication)
        {
            JobApplication otherJobApplication = (JobApplication)other;
            

            try
            {
                setCV (otherJobApplication.getCV ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setCoverLetter (otherJobApplication.getCoverLetter ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setApplicationStatus (otherJobApplication.getApplicationStatus ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setSubmittedDate (otherJobApplication.getSubmittedDate ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setGoogleAddressText (otherJobApplication.getGoogleAddressText ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setPreferRemote (otherJobApplication.getPreferRemote ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setHappyToRelocate (otherJobApplication.getHappyToRelocate ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setIsEmailIngest (otherJobApplication.getIsEmailIngest ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }

            try
            {
                setApplicantSource (otherJobApplication.getApplicantSource ());
            }
            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 BaseJobApplication)
        {
            BaseJobApplication sourceJobApplication = (BaseJobApplication)(source);

            _CV = sourceJobApplication._CV;
            _CoverLetter = sourceJobApplication._CoverLetter;
            _ApplicationStatus = sourceJobApplication._ApplicationStatus;
            _SubmittedDate = sourceJobApplication._SubmittedDate;
            _GoogleAddressText = sourceJobApplication._GoogleAddressText;
            _PreferRemote = sourceJobApplication._PreferRemote;
            _HappyToRelocate = sourceJobApplication._HappyToRelocate;
            _IsEmailIngest = sourceJobApplication._IsEmailIngest;
            _ApplicantSource = sourceJobApplication._ApplicantSource;
            _AppProcessOption = sourceJobApplication._AppProcessOption;
            _OverallRank = sourceJobApplication._OverallRank;
            _RoleFit = sourceJobApplication._RoleFit;
            _RequirementFit = sourceJobApplication._RequirementFit;
            _CultureFit = sourceJobApplication._CultureFit;
            _FactorScoreDetails = sourceJobApplication._FactorScoreDetails;
            _Note = sourceJobApplication._Note;
            
        }
    }


    /**
     * 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 BaseJobApplication)
        {
            BaseJobApplication sourceJobApplication = (BaseJobApplication)(source);

            _Candidate.copyFrom (sourceJobApplication._Candidate, linkToGhosts);
            _Job.copyFrom (sourceJobApplication._Job, linkToGhosts);
            _WorkFlowStage.copyFrom (sourceJobApplication._WorkFlowStage, 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 BaseJobApplication)
        {
            BaseJobApplication sourceJobApplication = (BaseJobApplication)(source);

            _AssessmentCriteriaAnswers.copyFrom (sourceJobApplication._AssessmentCriteriaAnswers, linkToGhosts);
            _Notes.copyFrom (sourceJobApplication._Notes, linkToGhosts);
            _ScheduledEmails.copyFrom (sourceJobApplication._ScheduledEmails, linkToGhosts);
            _SentEmails.copyFrom (sourceJobApplication._SentEmails, linkToGhosts);
            _Messages.copyFrom (sourceJobApplication._Messages, linkToGhosts);
            
        }
    }


    public void validate (ValidationContext context)
    {
        super.validate (context);

        
        context.check (getCandidateID() != null, this, SINGLEREFERENCE_Candidate, "mandatory");
        
        context.check (getJobID() != null, this, SINGLEREFERENCE_Job, "mandatory");
        
    }


    /**
     * Subclasses must override this to read in their attributes
     */
    protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
    {
        super.readExternalData(vals);

        _CV = (BinaryContent)(HELPER_CV.readExternal (_CV, vals.get(FIELD_CV))); //
        _CoverLetter = (BinaryContent)(HELPER_CoverLetter.readExternal (_CoverLetter, vals.get(FIELD_CoverLetter))); //
        _ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
        _SubmittedDate = (Date)(HELPER_SubmittedDate.readExternal (_SubmittedDate, vals.get(FIELD_SubmittedDate))); //
        _GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
        _PreferRemote = (Boolean)(HELPER_PreferRemote.readExternal (_PreferRemote, vals.get(FIELD_PreferRemote))); //
        _HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.readExternal (_HappyToRelocate, vals.get(FIELD_HappyToRelocate))); //
        _IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.readExternal (_IsEmailIngest, vals.get(FIELD_IsEmailIngest))); //
        _ApplicantSource = (ApplicantSource)(HELPER_ApplicantSource.readExternal (_ApplicantSource, vals.get(FIELD_ApplicantSource))); //
        _AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.readExternal (_AppProcessOption, vals.get(FIELD_AppProcessOption))); //
        _OverallRank = (Integer)(HELPER_OverallRank.readExternal (_OverallRank, vals.get(FIELD_OverallRank))); //
        _RoleFit = (Map)(HELPER_RoleFit.readExternal (_RoleFit, vals.get(FIELD_RoleFit))); //
        _RequirementFit = (Map)(HELPER_RequirementFit.readExternal (_RequirementFit, vals.get(FIELD_RequirementFit))); //
        _CultureFit = (Map)(HELPER_CultureFit.readExternal (_CultureFit, vals.get(FIELD_CultureFit))); //
        _FactorScoreDetails = (Map)(HELPER_FactorScoreDetails.readExternal (_FactorScoreDetails, vals.get(FIELD_FactorScoreDetails))); //
        _Note = (String)(HELPER_Note.readExternal (_Note, vals.get(FIELD_Note))); //
        _Candidate.readExternalData(vals.get(SINGLEREFERENCE_Candidate));
        _Job.readExternalData(vals.get(SINGLEREFERENCE_Job));
        _WorkFlowStage.readExternalData(vals.get(SINGLEREFERENCE_WorkFlowStage));
        _AssessmentCriteriaAnswers.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriteriaAnswers));
        _Notes.readExternalData(vals.get(MULTIPLEREFERENCE_Notes));
        _ScheduledEmails.readExternalData(vals.get(MULTIPLEREFERENCE_ScheduledEmails));
        _SentEmails.readExternalData(vals.get(MULTIPLEREFERENCE_SentEmails));
        _Messages.readExternalData(vals.get(MULTIPLEREFERENCE_Messages));
        
    }


    /**
     * Subclasses must override this to write out their attributes
     */
    protected void writeExternalData(Map<String, Object> vals) throws IOException
    {
        super.writeExternalData(vals);

        vals.put (FIELD_CV, HELPER_CV.writeExternal (_CV));
        vals.put (FIELD_CoverLetter, HELPER_CoverLetter.writeExternal (_CoverLetter));
        vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
        vals.put (FIELD_SubmittedDate, HELPER_SubmittedDate.writeExternal (_SubmittedDate));
        vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
        vals.put (FIELD_PreferRemote, HELPER_PreferRemote.writeExternal (_PreferRemote));
        vals.put (FIELD_HappyToRelocate, HELPER_HappyToRelocate.writeExternal (_HappyToRelocate));
        vals.put (FIELD_IsEmailIngest, HELPER_IsEmailIngest.writeExternal (_IsEmailIngest));
        vals.put (FIELD_ApplicantSource, HELPER_ApplicantSource.writeExternal (_ApplicantSource));
        vals.put (FIELD_AppProcessOption, HELPER_AppProcessOption.writeExternal (_AppProcessOption));
        vals.put (FIELD_OverallRank, HELPER_OverallRank.writeExternal (_OverallRank));
        vals.put (FIELD_RoleFit, HELPER_RoleFit.writeExternal (_RoleFit));
        vals.put (FIELD_RequirementFit, HELPER_RequirementFit.writeExternal (_RequirementFit));
        vals.put (FIELD_CultureFit, HELPER_CultureFit.writeExternal (_CultureFit));
        vals.put (FIELD_FactorScoreDetails, HELPER_FactorScoreDetails.writeExternal (_FactorScoreDetails));
        vals.put (FIELD_Note, HELPER_Note.writeExternal (_Note));
        vals.put (SINGLEREFERENCE_Candidate, _Candidate.writeExternalData());
        vals.put (SINGLEREFERENCE_Job, _Job.writeExternalData());
        vals.put (SINGLEREFERENCE_WorkFlowStage, _WorkFlowStage.writeExternalData());
        vals.put (MULTIPLEREFERENCE_AssessmentCriteriaAnswers, _AssessmentCriteriaAnswers.writeExternalData());
        vals.put (MULTIPLEREFERENCE_Notes, _Notes.writeExternalData());
        vals.put (MULTIPLEREFERENCE_ScheduledEmails, _ScheduledEmails.writeExternalData());
        vals.put (MULTIPLEREFERENCE_SentEmails, _SentEmails.writeExternalData());
        vals.put (MULTIPLEREFERENCE_Messages, _Messages.writeExternalData());
        
    }


    public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
    {
        super.compare (other, listener);

        if (other instanceof BaseJobApplication)
        {
            BaseJobApplication otherJobApplication = (BaseJobApplication)(other);

            
            if (!HELPER_CV.compare(this._CV, otherJobApplication._CV))
            {
                listener.notifyFieldChange(this, other, FIELD_CV, HELPER_CV.toObject(this._CV), HELPER_CV.toObject(otherJobApplication._CV));
            }
            if (!HELPER_CoverLetter.compare(this._CoverLetter, otherJobApplication._CoverLetter))
            {
                listener.notifyFieldChange(this, other, FIELD_CoverLetter, HELPER_CoverLetter.toObject(this._CoverLetter), HELPER_CoverLetter.toObject(otherJobApplication._CoverLetter));
            }
            if (!HELPER_ApplicationStatus.compare(this._ApplicationStatus, otherJobApplication._ApplicationStatus))
            {
                listener.notifyFieldChange(this, other, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(this._ApplicationStatus), HELPER_ApplicationStatus.toObject(otherJobApplication._ApplicationStatus));
            }
            if (!HELPER_SubmittedDate.compare(this._SubmittedDate, otherJobApplication._SubmittedDate))
            {
                listener.notifyFieldChange(this, other, FIELD_SubmittedDate, HELPER_SubmittedDate.toObject(this._SubmittedDate), HELPER_SubmittedDate.toObject(otherJobApplication._SubmittedDate));
            }
            if (!HELPER_GoogleAddressText.compare(this._GoogleAddressText, otherJobApplication._GoogleAddressText))
            {
                listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherJobApplication._GoogleAddressText));
            }
            if (!HELPER_PreferRemote.compare(this._PreferRemote, otherJobApplication._PreferRemote))
            {
                listener.notifyFieldChange(this, other, FIELD_PreferRemote, HELPER_PreferRemote.toObject(this._PreferRemote), HELPER_PreferRemote.toObject(otherJobApplication._PreferRemote));
            }
            if (!HELPER_HappyToRelocate.compare(this._HappyToRelocate, otherJobApplication._HappyToRelocate))
            {
                listener.notifyFieldChange(this, other, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(this._HappyToRelocate), HELPER_HappyToRelocate.toObject(otherJobApplication._HappyToRelocate));
            }
            if (!HELPER_IsEmailIngest.compare(this._IsEmailIngest, otherJobApplication._IsEmailIngest))
            {
                listener.notifyFieldChange(this, other, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(this._IsEmailIngest), HELPER_IsEmailIngest.toObject(otherJobApplication._IsEmailIngest));
            }
            if (!HELPER_ApplicantSource.compare(this._ApplicantSource, otherJobApplication._ApplicantSource))
            {
                listener.notifyFieldChange(this, other, FIELD_ApplicantSource, HELPER_ApplicantSource.toObject(this._ApplicantSource), HELPER_ApplicantSource.toObject(otherJobApplication._ApplicantSource));
            }

            // Compare single assocs
            _Candidate.compare (otherJobApplication._Candidate, listener);
            _Job.compare (otherJobApplication._Job, listener);
            _WorkFlowStage.compare (otherJobApplication._WorkFlowStage, listener);
            

            // Compare multiple assocs
            _AssessmentCriteriaAnswers.compare (otherJobApplication._AssessmentCriteriaAnswers, listener);
            _Notes.compare (otherJobApplication._Notes, listener);
            _ScheduledEmails.compare (otherJobApplication._ScheduledEmails, listener);
            _SentEmails.compare (otherJobApplication._SentEmails, listener);
            _Messages.compare (otherJobApplication._Messages, listener);
            
        }
    }


    public void visitTransients (AttributeVisitor visitor) throws StorageException
    {
        super.visitAttributes (visitor);

        visitor.visitField(this, FIELD_AppProcessOption, HELPER_AppProcessOption.toObject(getAppProcessOption()));
        visitor.visitField(this, FIELD_OverallRank, HELPER_OverallRank.toObject(getOverallRank()));
        visitor.visitField(this, FIELD_RoleFit, HELPER_RoleFit.toObject(getRoleFit()));
        visitor.visitField(this, FIELD_RequirementFit, HELPER_RequirementFit.toObject(getRequirementFit()));
        visitor.visitField(this, FIELD_CultureFit, HELPER_CultureFit.toObject(getCultureFit()));
        visitor.visitField(this, FIELD_FactorScoreDetails, HELPER_FactorScoreDetails.toObject(getFactorScoreDetails()));
        visitor.visitField(this, FIELD_Note, HELPER_Note.toObject(getNote()));
        
    }


    public void visitAttributes (AttributeVisitor visitor) throws StorageException
    {
        super.visitAttributes (visitor);

        visitor.visitField(this, FIELD_CV, HELPER_CV.toObject(getCV()));
        visitor.visitField(this, FIELD_CoverLetter, HELPER_CoverLetter.toObject(getCoverLetter()));
        visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
        visitor.visitField(this, FIELD_SubmittedDate, HELPER_SubmittedDate.toObject(getSubmittedDate()));
        visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
        visitor.visitField(this, FIELD_PreferRemote, HELPER_PreferRemote.toObject(getPreferRemote()));
        visitor.visitField(this, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(getHappyToRelocate()));
        visitor.visitField(this, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(getIsEmailIngest()));
        visitor.visitField(this, FIELD_ApplicantSource, HELPER_ApplicantSource.toObject(getApplicantSource()));
        visitor.visitAssociation (_Candidate);
        visitor.visitAssociation (_Job);
        visitor.visitAssociation (_WorkFlowStage);
        visitor.visitAssociation (_AssessmentCriteriaAnswers);
        visitor.visitAssociation (_Notes);
        visitor.visitAssociation (_ScheduledEmails);
        visitor.visitAssociation (_SentEmails);
        visitor.visitAssociation (_Messages);
        
    }


    public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
    {
        super.visitAssociations (visitor, scope);

        if (scope.includes (_Candidate))
        {
            visitor.visit (_Candidate);
        }
        if (scope.includes (_Job))
        {
            visitor.visit (_Job);
        }
        if (scope.includes (_WorkFlowStage))
        {
            visitor.visit (_WorkFlowStage);
        }
        if (scope.includes (_AssessmentCriteriaAnswers))
        {
            visitor.visit (_AssessmentCriteriaAnswers);
        }
        if (scope.includes (_Notes))
        {
            visitor.visit (_Notes);
        }
        if (scope.includes (_ScheduledEmails))
        {
            visitor.visit (_ScheduledEmails);
        }
        if (scope.includes (_SentEmails))
        {
            visitor.visit (_SentEmails);
        }
        if (scope.includes (_Messages))
        {
            visitor.visit (_Messages);
        }
        
    }


    public static JobApplication createJobApplication (ObjectTransaction transaction) throws StorageException
    {
        JobApplication     result = new JobApplication ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static JobApplication getJobApplicationByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (JobApplication)(transaction.getObjectByID (REFERENCE_JobApplication, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_CV))
        {
            return filter.matches (getCV ());
        }
        else if (attribName.equals (FIELD_CoverLetter))
        {
            return filter.matches (getCoverLetter ());
        }
        else if (attribName.equals (FIELD_ApplicationStatus))
        {
            return filter.matches (getApplicationStatus ());
        }
        else if (attribName.equals (FIELD_SubmittedDate))
        {
            return filter.matches (getSubmittedDate ());
        }
        else if (attribName.equals (FIELD_GoogleAddressText))
        {
            return filter.matches (getGoogleAddressText ());
        }
        else if (attribName.equals (FIELD_PreferRemote))
        {
            return filter.matches (getPreferRemote ());
        }
        else if (attribName.equals (FIELD_HappyToRelocate))
        {
            return filter.matches (getHappyToRelocate ());
        }
        else if (attribName.equals (FIELD_IsEmailIngest))
        {
            return filter.matches (getIsEmailIngest ());
        }
        else if (attribName.equals (FIELD_ApplicantSource))
        {
            return filter.matches (getApplicantSource ());
        }
        else if (attribName.equals (SINGLEREFERENCE_Candidate))
        {
            return filter.matches (getCandidate ());
        }
        else if (attribName.equals (SINGLEREFERENCE_Job))
        {
            return filter.matches (getJob ());
        }
        else if (attribName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return filter.matches (getWorkFlowStage ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }


    public static SearchAll SearchByAll () { return new SearchAll (); }

    public static class SearchAll extends SearchObject<JobApplication>
    {
        public SearchAll andObjectID (QueryFilter<Long> filter)
        {
            filter.addFilter (context, "tl_job_application.object_id", FIELD_ObjectID);
            return this;
        }

        public SearchAll andObjectCreated (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_created_date", FIELD_ObjectCreated);
            return this;
        }

        public SearchAll andObjectLastModified (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_last_updated_date", FIELD_ObjectLastModified);
            return this;
        }

            
        public SearchAll andCV (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cv", "CV");
            return this;
        }
            
        public SearchAll andCoverLetter (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cover_letter", "CoverLetter");
            return this;
        }
            
        public SearchAll andApplicationStatus (QueryFilter<ApplicationStatus> filter)
        {
            filter.addFilter (context, "tl_job_application.application_status", "ApplicationStatus");
            return this;
        }
            
        public SearchAll andSubmittedDate (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.submitted_date", "SubmittedDate");
            return this;
        }
            
        public SearchAll andGoogleAddressText (QueryFilter<String> filter)
        {
            filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
            return this;
        }
            
        public SearchAll andPreferRemote (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
            return this;
        }
            
        public SearchAll andHappyToRelocate (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
            return this;
        }
            
        public SearchAll andIsEmailIngest (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.is_email_ingest", "IsEmailIngest");
            return this;
        }
            
        public SearchAll andApplicantSource (QueryFilter<ApplicantSource> filter)
        {
            filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
            return this;
        }
            
        public SearchAll andCandidate (QueryFilter<Candidate> filter)
        {
            filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
            return this;
        }
            
        public SearchAll andJob (QueryFilter<Job> filter)
        {
            filter.addFilter (context, "tl_job_application.job_id", "Job");
            return this;
        }
            
        public SearchAll andWorkFlowStage (QueryFilter<WorkFlowStage> filter)
        {
            filter.addFilter (context, "tl_job_application.work_flow_stage_id", "WorkFlowStage");
            return this;
        }
            
        public JobApplication[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_JobApplication, SEARCH_All, criteria);
            Set<JobApplication>   typedResults = new LinkedHashSet <JobApplication> ();
            for (BaseBusinessClass bbcResult : results)
            {
                JobApplication aResult = (JobApplication)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new JobApplication[0]);
                            
        }
    }

        
    public static JobApplication[] searchAll (ObjectTransaction transaction) throws StorageException
    {
        return SearchByAll ()
               .search (transaction);
    }

        public abstract boolean filterCandidateJob(Candidate Candidate, Job Job) throws StorageException;
    
    public static SearchCandidateJob SearchByCandidateJob () { return new SearchCandidateJob (); }

    public static class SearchCandidateJob extends SearchObject<JobApplication>
    {
        public SearchCandidateJob byCandidate (Candidate Candidate)
        {
            by ("Candidate", Candidate);
            return this;
        }
        
        public SearchCandidateJob byJob (Job Job)
        {
            by ("Job", Job);
            return this;
        }
        
        public SearchCandidateJob andObjectID (QueryFilter<Long> filter)
        {
            filter.addFilter (context, "tl_job_application.object_id", FIELD_ObjectID);
            return this;
        }

        public SearchCandidateJob andObjectCreated (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_created_date", FIELD_ObjectCreated);
            return this;
        }

        public SearchCandidateJob andObjectLastModified (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_last_updated_date", FIELD_ObjectLastModified);
            return this;
        }

            
        public SearchCandidateJob andCV (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cv", "CV");
            return this;
        }
            
        public SearchCandidateJob andCoverLetter (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cover_letter", "CoverLetter");
            return this;
        }
            
        public SearchCandidateJob andApplicationStatus (QueryFilter<ApplicationStatus> filter)
        {
            filter.addFilter (context, "tl_job_application.application_status", "ApplicationStatus");
            return this;
        }
            
        public SearchCandidateJob andSubmittedDate (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.submitted_date", "SubmittedDate");
            return this;
        }
            
        public SearchCandidateJob andGoogleAddressText (QueryFilter<String> filter)
        {
            filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
            return this;
        }
            
        public SearchCandidateJob andPreferRemote (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
            return this;
        }
            
        public SearchCandidateJob andHappyToRelocate (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
            return this;
        }
            
        public SearchCandidateJob andIsEmailIngest (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.is_email_ingest", "IsEmailIngest");
            return this;
        }
            
        public SearchCandidateJob andApplicantSource (QueryFilter<ApplicantSource> filter)
        {
            filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
            return this;
        }
            
        public SearchCandidateJob andCandidate (QueryFilter<Candidate> filter)
        {
            filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
            return this;
        }
            
        public SearchCandidateJob andJob (QueryFilter<Job> filter)
        {
            filter.addFilter (context, "tl_job_application.job_id", "Job");
            return this;
        }
            
        public SearchCandidateJob andWorkFlowStage (QueryFilter<WorkFlowStage> filter)
        {
            filter.addFilter (context, "tl_job_application.work_flow_stage_id", "WorkFlowStage");
            return this;
        }
            
        public JobApplication search (ObjectTransaction transaction) throws StorageException
        {Candidate Candidate = (Candidate)criteria.get ("Candidate");
                Job Job = (Job)criteria.get ("Job");
                
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_JobApplication, SEARCH_CandidateJob, criteria);
            Set<JobApplication>   typedResults = new LinkedHashSet <JobApplication> ();
            for (BaseBusinessClass bbcResult : results)
            {
                JobApplication aResult = (JobApplication)bbcResult;
                
                // Check in case in memory objects should be excluded
                if (!aResult.filterCandidateJob(Candidate, Job) || !filterAndsInMemory (aResult))
                {
                    continue;
                }
                
                typedResults.add (aResult);
            }
            
            // Check in memory objects for matches
            for (BaseBusinessClass bbcInMemory : transaction.getObjectsToStore ())
            {
                if (bbcInMemory instanceof JobApplication)
                {
                    JobApplication aInMemory = (JobApplication)bbcInMemory;

                    if (!aInMemory.filterCandidateJob(Candidate, Job) || !filterAndsInMemory (aInMemory))
                    {
                        continue;
                    }

                    typedResults.add (aInMemory);
                }
            }
            
            return (JobApplication)singletonResult(ObjstoreUtils.removeDeleted(transaction, typedResults).toArray(new BaseBusinessClass[0]), "JobApplication", "");
                            
        }
    }

        
    public static JobApplication searchCandidateJob (ObjectTransaction transaction, Candidate Candidate, Job Job) throws StorageException
    {
        return SearchByCandidateJob ()
               .byCandidate  (Candidate).byJob  (Job).search (transaction);
    }

    public static SearchDetails SearchByDetails () { return new SearchDetails (); }

    public static class SearchDetails extends SearchObject<JobApplication>
    {
        public SearchDetails byName (String Name)
        {
            by ("Name", Name);
            return this;
        }
        
        public SearchDetails andObjectID (QueryFilter<Long> filter)
        {
            filter.addFilter (context, "tl_job_application.object_id", FIELD_ObjectID);
            return this;
        }

        public SearchDetails andObjectCreated (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_created_date", FIELD_ObjectCreated);
            return this;
        }

        public SearchDetails andObjectLastModified (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_last_updated_date", FIELD_ObjectLastModified);
            return this;
        }

            
        public SearchDetails andCV (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cv", "CV");
            return this;
        }
            
        public SearchDetails andCoverLetter (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cover_letter", "CoverLetter");
            return this;
        }
            
        public SearchDetails andApplicationStatus (QueryFilter<ApplicationStatus> filter)
        {
            filter.addFilter (context, "tl_job_application.application_status", "ApplicationStatus");
            return this;
        }
            
        public SearchDetails andSubmittedDate (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.submitted_date", "SubmittedDate");
            return this;
        }
            
        public SearchDetails andGoogleAddressText (QueryFilter<String> filter)
        {
            filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
            return this;
        }
            
        public SearchDetails andPreferRemote (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
            return this;
        }
            
        public SearchDetails andHappyToRelocate (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
            return this;
        }
            
        public SearchDetails andIsEmailIngest (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.is_email_ingest", "IsEmailIngest");
            return this;
        }
            
        public SearchDetails andApplicantSource (QueryFilter<ApplicantSource> filter)
        {
            filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
            return this;
        }
            
        public SearchDetails andCandidate (QueryFilter<Candidate> filter)
        {
            filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
            return this;
        }
            
        public SearchDetails andJob (QueryFilter<Job> filter)
        {
            filter.addFilter (context, "tl_job_application.job_id", "Job");
            return this;
        }
            
        public SearchDetails andWorkFlowStage (QueryFilter<WorkFlowStage> filter)
        {
            filter.addFilter (context, "tl_job_application.work_flow_stage_id", "WorkFlowStage");
            return this;
        }
            
        public JobApplication[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_JobApplication, SEARCH_Details, criteria);
            Set<JobApplication>   typedResults = new LinkedHashSet <JobApplication> ();
            for (BaseBusinessClass bbcResult : results)
            {
                JobApplication aResult = (JobApplication)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new JobApplication[0]);
                            
        }
    }

        
    public static JobApplication[] searchDetails (ObjectTransaction transaction, String Name) throws StorageException
    {
        return SearchByDetails ()
               .byName  (Name).search (transaction);
    }

    public static SearchStageType SearchByStageType () { return new SearchStageType (); }

    public static class SearchStageType extends SearchObject<JobApplication>
    {
        public SearchStageType byStageTypesNotIn (Set<StageType> StageTypesNotIn)
        {
            by ("StageTypesNotIn", StageTypesNotIn);
            return this;
        }
        
        public SearchStageType byStageTypesIn (Set<StageType> StageTypesIn)
        {
            by ("StageTypesIn", StageTypesIn);
            return this;
        }
        
        public SearchStageType andObjectID (QueryFilter<Long> filter)
        {
            filter.addFilter (context, "tl_job_application.object_id", FIELD_ObjectID);
            return this;
        }

        public SearchStageType andObjectCreated (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_created_date", FIELD_ObjectCreated);
            return this;
        }

        public SearchStageType andObjectLastModified (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.object_last_updated_date", FIELD_ObjectLastModified);
            return this;
        }

            
        public SearchStageType andCV (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cv", "CV");
            return this;
        }
            
        public SearchStageType andCoverLetter (QueryFilter<BinaryContent> filter)
        {
            filter.addFilter (context, "tl_job_application.cover_letter", "CoverLetter");
            return this;
        }
            
        public SearchStageType andApplicationStatus (QueryFilter<ApplicationStatus> filter)
        {
            filter.addFilter (context, "tl_job_application.application_status", "ApplicationStatus");
            return this;
        }
            
        public SearchStageType andSubmittedDate (QueryFilter<Date> filter)
        {
            filter.addFilter (context, "tl_job_application.submitted_date", "SubmittedDate");
            return this;
        }
            
        public SearchStageType andGoogleAddressText (QueryFilter<String> filter)
        {
            filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
            return this;
        }
            
        public SearchStageType andPreferRemote (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
            return this;
        }
            
        public SearchStageType andHappyToRelocate (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
            return this;
        }
            
        public SearchStageType andIsEmailIngest (QueryFilter<Boolean> filter)
        {
            filter.addFilter (context, "tl_job_application.is_email_ingest", "IsEmailIngest");
            return this;
        }
            
        public SearchStageType andApplicantSource (QueryFilter<ApplicantSource> filter)
        {
            filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
            return this;
        }
            
        public SearchStageType andCandidate (QueryFilter<Candidate> filter)
        {
            filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
            return this;
        }
            
        public SearchStageType andJob (QueryFilter<Job> filter)
        {
            filter.addFilter (context, "tl_job_application.job_id", "Job");
            return this;
        }
            
        public SearchStageType andWorkFlowStage (QueryFilter<WorkFlowStage> filter)
        {
            filter.addFilter (context, "tl_job_application.work_flow_stage_id", "WorkFlowStage");
            return this;
        }
            
        public JobApplication[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_JobApplication, SEARCH_StageType, criteria);
            Set<JobApplication>   typedResults = new LinkedHashSet <JobApplication> ();
            for (BaseBusinessClass bbcResult : results)
            {
                JobApplication aResult = (JobApplication)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new JobApplication[0]);
                            
        }
    }

        
    public static JobApplication[] searchStageType (ObjectTransaction transaction, Set<StageType> StageTypesNotIn, Set<StageType> StageTypesIn) throws StorageException
    {
        return SearchByStageType ()
               .byStageTypesNotIn  (StageTypesNotIn).byStageTypesIn  (StageTypesIn).search (transaction);
    }



    public Object getAttribute (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_CV))
        {
            return HELPER_CV.toObject (getCV ());
        }
        else if (attribName.equals (FIELD_CoverLetter))
        {
            return HELPER_CoverLetter.toObject (getCoverLetter ());
        }
        else if (attribName.equals (FIELD_ApplicationStatus))
        {
            return HELPER_ApplicationStatus.toObject (getApplicationStatus ());
        }
        else if (attribName.equals (FIELD_SubmittedDate))
        {
            return HELPER_SubmittedDate.toObject (getSubmittedDate ());
        }
        else if (attribName.equals (FIELD_GoogleAddressText))
        {
            return HELPER_GoogleAddressText.toObject (getGoogleAddressText ());
        }
        else if (attribName.equals (FIELD_PreferRemote))
        {
            return HELPER_PreferRemote.toObject (getPreferRemote ());
        }
        else if (attribName.equals (FIELD_HappyToRelocate))
        {
            return HELPER_HappyToRelocate.toObject (getHappyToRelocate ());
        }
        else if (attribName.equals (FIELD_IsEmailIngest))
        {
            return HELPER_IsEmailIngest.toObject (getIsEmailIngest ());
        }
        else if (attribName.equals (FIELD_ApplicantSource))
        {
            return HELPER_ApplicantSource.toObject (getApplicantSource ());
        }
        else if (attribName.equals (FIELD_AppProcessOption))
        {
            return HELPER_AppProcessOption.toObject (getAppProcessOption ());
        }
        else if (attribName.equals (FIELD_OverallRank))
        {
            return HELPER_OverallRank.toObject (getOverallRank ());
        }
        else if (attribName.equals (FIELD_RoleFit))
        {
            return HELPER_RoleFit.toObject (getRoleFit ());
        }
        else if (attribName.equals (FIELD_RequirementFit))
        {
            return HELPER_RequirementFit.toObject (getRequirementFit ());
        }
        else if (attribName.equals (FIELD_CultureFit))
        {
            return HELPER_CultureFit.toObject (getCultureFit ());
        }
        else if (attribName.equals (FIELD_FactorScoreDetails))
        {
            return HELPER_FactorScoreDetails.toObject (getFactorScoreDetails ());
        }
        else if (attribName.equals (FIELD_Note))
        {
            return HELPER_Note.toObject (getNote ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_CV))
        {
            return HELPER_CV;
        }
        else if (attribName.equals (FIELD_CoverLetter))
        {
            return HELPER_CoverLetter;
        }
        else if (attribName.equals (FIELD_ApplicationStatus))
        {
            return HELPER_ApplicationStatus;
        }
        else if (attribName.equals (FIELD_SubmittedDate))
        {
            return HELPER_SubmittedDate;
        }
        else if (attribName.equals (FIELD_GoogleAddressText))
        {
            return HELPER_GoogleAddressText;
        }
        else if (attribName.equals (FIELD_PreferRemote))
        {
            return HELPER_PreferRemote;
        }
        else if (attribName.equals (FIELD_HappyToRelocate))
        {
            return HELPER_HappyToRelocate;
        }
        else if (attribName.equals (FIELD_IsEmailIngest))
        {
            return HELPER_IsEmailIngest;
        }
        else if (attribName.equals (FIELD_ApplicantSource))
        {
            return HELPER_ApplicantSource;
        }
        else if (attribName.equals (FIELD_AppProcessOption))
        {
            return HELPER_AppProcessOption;
        }
        else if (attribName.equals (FIELD_OverallRank))
        {
            return HELPER_OverallRank;
        }
        else if (attribName.equals (FIELD_RoleFit))
        {
            return HELPER_RoleFit;
        }
        else if (attribName.equals (FIELD_RequirementFit))
        {
            return HELPER_RequirementFit;
        }
        else if (attribName.equals (FIELD_CultureFit))
        {
            return HELPER_CultureFit;
        }
        else if (attribName.equals (FIELD_FactorScoreDetails))
        {
            return HELPER_FactorScoreDetails;
        }
        else if (attribName.equals (FIELD_Note))
        {
            return HELPER_Note;
        }
        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_CV))
        {
            setCV ((BinaryContent)(HELPER_CV.fromObject (_CV, attribValue)));            
        }
        else if (attribName.equals (FIELD_CoverLetter))
        {
            setCoverLetter ((BinaryContent)(HELPER_CoverLetter.fromObject (_CoverLetter, attribValue)));            
        }
        else if (attribName.equals (FIELD_ApplicationStatus))
        {
            setApplicationStatus ((ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, attribValue)));            
        }
        else if (attribName.equals (FIELD_SubmittedDate))
        {
            setSubmittedDate ((Date)(HELPER_SubmittedDate.fromObject (_SubmittedDate, attribValue)));            
        }
        else if (attribName.equals (FIELD_GoogleAddressText))
        {
            setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue)));            
        }
        else if (attribName.equals (FIELD_PreferRemote))
        {
            setPreferRemote ((Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, attribValue)));            
        }
        else if (attribName.equals (FIELD_HappyToRelocate))
        {
            setHappyToRelocate ((Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, attribValue)));            
        }
        else if (attribName.equals (FIELD_IsEmailIngest))
        {
            setIsEmailIngest ((Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, attribValue)));            
        }
        else if (attribName.equals (FIELD_ApplicantSource))
        {
            setApplicantSource ((ApplicantSource)(HELPER_ApplicantSource.fromObject (_ApplicantSource, attribValue)));            
        }
        else if (attribName.equals (FIELD_AppProcessOption))
        {
            setAppProcessOption ((AppProcessOption)(HELPER_AppProcessOption.fromObject (_AppProcessOption, attribValue)));            
        }
        else if (attribName.equals (FIELD_OverallRank))
        {
            setOverallRank ((Integer)(HELPER_OverallRank.fromObject (_OverallRank, attribValue)));            
        }
        else if (attribName.equals (FIELD_RoleFit))
        {
            setRoleFit ((Map)(HELPER_RoleFit.fromObject (_RoleFit, attribValue)));            
        }
        else if (attribName.equals (FIELD_RequirementFit))
        {
            setRequirementFit ((Map)(HELPER_RequirementFit.fromObject (_RequirementFit, attribValue)));            
        }
        else if (attribName.equals (FIELD_CultureFit))
        {
            setCultureFit ((Map)(HELPER_CultureFit.fromObject (_CultureFit, attribValue)));            
        }
        else if (attribName.equals (FIELD_FactorScoreDetails))
        {
            setFactorScoreDetails ((Map)(HELPER_FactorScoreDetails.fromObject (_FactorScoreDetails, attribValue)));            
        }
        else if (attribName.equals (FIELD_Note))
        {
            setNote ((String)(HELPER_Note.fromObject (_Note, attribValue)));            
        }
        else
        {
            super.setAttribute (attribName, attribValue);
        }
    }

    

    public boolean isWriteable (String fieldName)
    {        
        return getWriteable (fieldName) == FieldWriteability.TRUE;
    }

    public boolean isReadable ()
    {
        return super.isReadable();
    }

    public boolean isReadable (String fieldName)
    {
        return super.isReadable(fieldName);
    }


    public FieldWriteability getWriteable (String fieldName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (fieldName.equals (FIELD_CV))
        {
            return getWriteability_CV ();
        }
        else if (fieldName.equals (FIELD_CoverLetter))
        {
            return getWriteability_CoverLetter ();
        }
        else if (fieldName.equals (FIELD_ApplicationStatus))
        {
            return getWriteability_ApplicationStatus ();
        }
        else if (fieldName.equals (FIELD_SubmittedDate))
        {
            return getWriteability_SubmittedDate ();
        }
        else if (fieldName.equals (FIELD_GoogleAddressText))
        {
            return getWriteability_GoogleAddressText ();
        }
        else if (fieldName.equals (FIELD_PreferRemote))
        {
            return getWriteability_PreferRemote ();
        }
        else if (fieldName.equals (FIELD_HappyToRelocate))
        {
            return getWriteability_HappyToRelocate ();
        }
        else if (fieldName.equals (FIELD_IsEmailIngest))
        {
            return getWriteability_IsEmailIngest ();
        }
        else if (fieldName.equals (FIELD_ApplicantSource))
        {
            return getWriteability_ApplicantSource ();
        }
        else if (fieldName.equals (MULTIPLEREFERENCE_AssessmentCriteriaAnswers))
        {
            return getWriteability_AssessmentCriteriaAnswers ();
        }
        else if (fieldName.equals (MULTIPLEREFERENCE_Notes))
        {
            return getWriteability_Notes ();
        }
        else if (fieldName.equals (MULTIPLEREFERENCE_ScheduledEmails))
        {
            return getWriteability_ScheduledEmails ();
        }
        else if (fieldName.equals (MULTIPLEREFERENCE_SentEmails))
        {
            return getWriteability_SentEmails ();
        }
        else if (fieldName.equals (MULTIPLEREFERENCE_Messages))
        {
            return getWriteability_Messages ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Candidate))
        {
            return getWriteability_Candidate ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Job))
        {
            return getWriteability_Job ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_WorkFlowStage))
        {
            return getWriteability_WorkFlowStage ();
        }
        else if (fieldName.equals (FIELD_AppProcessOption))
        {
            return getWriteability_AppProcessOption ();
        }
        else if (fieldName.equals (FIELD_OverallRank))
        {
            return getWriteability_OverallRank ();
        }
        else if (fieldName.equals (FIELD_RoleFit))
        {
            return getWriteability_RoleFit ();
        }
        else if (fieldName.equals (FIELD_RequirementFit))
        {
            return getWriteability_RequirementFit ();
        }
        else if (fieldName.equals (FIELD_CultureFit))
        {
            return getWriteability_CultureFit ();
        }
        else if (fieldName.equals (FIELD_FactorScoreDetails))
        {
            return getWriteability_FactorScoreDetails ();
        }
        else if (fieldName.equals (FIELD_Note))
        {
            return getWriteability_Note ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        if (getWriteability_CV () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_CV);
        }
        
        if (getWriteability_CoverLetter () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_CoverLetter);
        }
        
        if (getWriteability_ApplicationStatus () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_ApplicationStatus);
        }
        
        if (getWriteability_SubmittedDate () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_SubmittedDate);
        }
        
        if (getWriteability_GoogleAddressText () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_GoogleAddressText);
        }
        
        if (getWriteability_PreferRemote () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_PreferRemote);
        }
        
        if (getWriteability_HappyToRelocate () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_HappyToRelocate);
        }
        
        if (getWriteability_IsEmailIngest () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_IsEmailIngest);
        }
        
        if (getWriteability_ApplicantSource () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_ApplicantSource);
        }
        
        if (getWriteability_AppProcessOption () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_AppProcessOption);
        }
        
        if (getWriteability_OverallRank () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_OverallRank);
        }
        
        if (getWriteability_RoleFit () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_RoleFit);
        }
        
        if (getWriteability_RequirementFit () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_RequirementFit);
        }
        
        if (getWriteability_CultureFit () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_CultureFit);
        }
        
        if (getWriteability_FactorScoreDetails () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_FactorScoreDetails);
        }
        
        if (getWriteability_Note () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_Note);
        }
        

        super.putUnwriteable (fields);
    }

    public String[] getAllTableNames()
    {
        return new String[] {"tl_job_application"};
    }
    
    public boolean isPolymorphic(String tableName)
    {
        return super.isPolymorphic(tableName);
    }


    public List<AbstractAttribute> getAttributes ()
    {
        List result = super.getAttributes ();

        
        result.add(HELPER_CV.getAttribObject (getClass (), _CV, false, FIELD_CV));
        result.add(HELPER_CoverLetter.getAttribObject (getClass (), _CoverLetter, false, FIELD_CoverLetter));
        result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
        result.add(HELPER_SubmittedDate.getAttribObject (getClass (), _SubmittedDate, false, FIELD_SubmittedDate));
        result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
        result.add(HELPER_PreferRemote.getAttribObject (getClass (), _PreferRemote, false, FIELD_PreferRemote));
        result.add(HELPER_HappyToRelocate.getAttribObject (getClass (), _HappyToRelocate, false, FIELD_HappyToRelocate));
        result.add(HELPER_IsEmailIngest.getAttribObject (getClass (), _IsEmailIngest, false, FIELD_IsEmailIngest));
        result.add(HELPER_ApplicantSource.getAttribObject (getClass (), _ApplicantSource, false, FIELD_ApplicantSource));
        result.add(HELPER_AppProcessOption.getAttribObject (getClass (), _AppProcessOption, false, FIELD_AppProcessOption));
        result.add(HELPER_OverallRank.getAttribObject (getClass (), _OverallRank, false, FIELD_OverallRank));
        result.add(HELPER_RoleFit.getAttribObject (getClass (), _RoleFit, false, FIELD_RoleFit));
        result.add(HELPER_RequirementFit.getAttribObject (getClass (), _RequirementFit, false, FIELD_RequirementFit));
        result.add(HELPER_CultureFit.getAttribObject (getClass (), _CultureFit, false, FIELD_CultureFit));
        result.add(HELPER_FactorScoreDetails.getAttribObject (getClass (), _FactorScoreDetails, false, FIELD_FactorScoreDetails));
        result.add(HELPER_Note.getAttribObject (getClass (), _Note, false, FIELD_Note));

        return result;
    }


    public Map getAttributeMetadata (String attribute)
    {
        if (ATTRIBUTES_METADATA_JobApplication.containsKey (attribute))
        {
            return (Map)ATTRIBUTES_METADATA_JobApplication.get (attribute);
        }
        else
        {
            return super.getAttributeMetadata (attribute);
        }
    }


    public Object getAttributeMetadata (String attribute, String metadata)
    {
        if (ATTRIBUTES_METADATA_JobApplication.containsKey (attribute))
        {
            return ((Map)ATTRIBUTES_METADATA_JobApplication.get (attribute)).get(metadata);
        }
        else
        {
            return super.getAttributeMetadata (attribute, metadata);
        }
    }

    public void copyAllAttributeMetadata (Map copyInto)
    {
        super.copyAllAttributeMetadata(copyInto);

        copyInto.putAll(ATTRIBUTES_METADATA_JobApplication);
    }
            

    public void preCommit (boolean willBeStored) throws Exception
    {
        super.preCommit(willBeStored);
        
        if(willBeStored)
        {
        
          {  
            oneit.servlets.objstore.binary.BinaryContentHandler bchandler = oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
              
            if(bchandler != null)
            {
                bchandler.preCommit(willBeStored, this, "CV");
            }
            else
            {
                LogMgr.log(BUSINESS_OBJECTS, LogLevel.SYSTEMWARNING, "Unknown BinaryContentHandler loggedin on attribute CV");
            }
          }
          
          {  
            oneit.servlets.objstore.binary.BinaryContentHandler bchandler = oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
              
            if(bchandler != null)
            {
                bchandler.preCommit(willBeStored, this, "CoverLetter");
            }
            else
            {
                LogMgr.log(BUSINESS_OBJECTS, LogLevel.SYSTEMWARNING, "Unknown BinaryContentHandler loggedin on attribute CoverLetter");
            }
          }
          
        }
    }

    public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
    {
        if(CollectionUtils.equals(attribName, "CV"))      
        {  
            return oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
        }     
          
        if(CollectionUtils.equals(attribName, "CoverLetter"))      
        {  
            return oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
        }     
          
        
        return super.getBinaryContentHandler(attribName);
    }

    public static class JobApplicationBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<JobApplication>
    {

    /**
     * Get the attribute CV
     */
    public BinaryContent getCV (JobApplication obj, BinaryContent original)
    {
        return original;
    }

    /**
     * Change the value set for attribute CV.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public BinaryContent setCV (JobApplication obj, BinaryContent newCV) throws FieldException
    {
        return newCV;
    }

    /**
     * Get the attribute CoverLetter
     */
    public BinaryContent getCoverLetter (JobApplication obj, BinaryContent original)
    {
        return original;
    }

    /**
     * Change the value set for attribute CoverLetter.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public BinaryContent setCoverLetter (JobApplication obj, BinaryContent newCoverLetter) throws FieldException
    {
        return newCoverLetter;
    }

    /**
     * Get the attribute ApplicationStatus
     */
    public ApplicationStatus getApplicationStatus (JobApplication obj, ApplicationStatus original)
    {
        return original;
    }

    /**
     * Change the value set for attribute ApplicationStatus.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public ApplicationStatus setApplicationStatus (JobApplication obj, ApplicationStatus newApplicationStatus) throws FieldException
    {
        return newApplicationStatus;
    }

    /**
     * Get the attribute SubmittedDate
     */
    public Date getSubmittedDate (JobApplication obj, Date original)
    {
        return original;
    }

    /**
     * Change the value set for attribute SubmittedDate.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Date setSubmittedDate (JobApplication obj, Date newSubmittedDate) throws FieldException
    {
        return newSubmittedDate;
    }

    /**
     * Get the attribute GoogleAddressText
     */
    public String getGoogleAddressText (JobApplication obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute GoogleAddressText.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setGoogleAddressText (JobApplication obj, String newGoogleAddressText) throws FieldException
    {
        return newGoogleAddressText;
    }

    /**
     * Get the attribute PreferRemote
     */
    public Boolean getPreferRemote (JobApplication obj, Boolean original)
    {
        return original;
    }

    /**
     * Change the value set for attribute PreferRemote.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Boolean setPreferRemote (JobApplication obj, Boolean newPreferRemote) throws FieldException
    {
        return newPreferRemote;
    }

    /**
     * Get the attribute HappyToRelocate
     */
    public Boolean getHappyToRelocate (JobApplication obj, Boolean original)
    {
        return original;
    }

    /**
     * Change the value set for attribute HappyToRelocate.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Boolean setHappyToRelocate (JobApplication obj, Boolean newHappyToRelocate) throws FieldException
    {
        return newHappyToRelocate;
    }

    /**
     * Get the attribute IsEmailIngest
     */
    public Boolean getIsEmailIngest (JobApplication obj, Boolean original)
    {
        return original;
    }

    /**
     * Change the value set for attribute IsEmailIngest.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Boolean setIsEmailIngest (JobApplication obj, Boolean newIsEmailIngest) throws FieldException
    {
        return newIsEmailIngest;
    }

    /**
     * Get the attribute ApplicantSource
     */
    public ApplicantSource getApplicantSource (JobApplication obj, ApplicantSource original)
    {
        return original;
    }

    /**
     * Change the value set for attribute ApplicantSource.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public ApplicantSource setApplicantSource (JobApplication obj, ApplicantSource newApplicantSource) throws FieldException
    {
        return newApplicantSource;
    }

    /**
     * Get the attribute AppProcessOption
     */
    public AppProcessOption getAppProcessOption (JobApplication obj, AppProcessOption original)
    {
        return original;
    }

    /**
     * Change the value set for attribute AppProcessOption.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public AppProcessOption setAppProcessOption (JobApplication obj, AppProcessOption newAppProcessOption) throws FieldException
    {
        return newAppProcessOption;
    }

    /**
     * Get the attribute OverallRank
     */
    public Integer getOverallRank (JobApplication obj, Integer original)
    {
        return original;
    }

    /**
     * Change the value set for attribute OverallRank.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Integer setOverallRank (JobApplication obj, Integer newOverallRank) throws FieldException
    {
        return newOverallRank;
    }

    /**
     * Get the attribute RoleFit
     */
    public Map getRoleFit (JobApplication obj, Map original)
    {
        return original;
    }

    /**
     * Change the value set for attribute RoleFit.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Map setRoleFit (JobApplication obj, Map newRoleFit) throws FieldException
    {
        return newRoleFit;
    }

    /**
     * Get the attribute RequirementFit
     */
    public Map getRequirementFit (JobApplication obj, Map original)
    {
        return original;
    }

    /**
     * Change the value set for attribute RequirementFit.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Map setRequirementFit (JobApplication obj, Map newRequirementFit) throws FieldException
    {
        return newRequirementFit;
    }

    /**
     * Get the attribute CultureFit
     */
    public Map getCultureFit (JobApplication obj, Map original)
    {
        return original;
    }

    /**
     * Change the value set for attribute CultureFit.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Map setCultureFit (JobApplication obj, Map newCultureFit) throws FieldException
    {
        return newCultureFit;
    }

    /**
     * Get the attribute FactorScoreDetails
     */
    public Map getFactorScoreDetails (JobApplication obj, Map original)
    {
        return original;
    }

    /**
     * Change the value set for attribute FactorScoreDetails.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Map setFactorScoreDetails (JobApplication obj, Map newFactorScoreDetails) throws FieldException
    {
        return newFactorScoreDetails;
    }

    /**
     * Get the attribute Note
     */
    public String getNote (JobApplication obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Note.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setNote (JobApplication obj, String newNote) throws FieldException
    {
        return newNote;
    }

    }

    @Override
    public ORMPipeLine pipes()
    {
        return new JobApplicationPipeLineFactory<JobApplication, JobApplication> ((JobApplication)this);
    }

    @Override
    public ORMPipeLine pipes(Collection _items)
    {
        return pipesJobApplication(_items);
    }
      
    /**
     * Use this instead of pipes() to get rid of type casting.
     */  
    public JobApplicationPipeLineFactory<JobApplication, JobApplication> pipelineJobApplication()
    {
        return (JobApplicationPipeLineFactory<JobApplication, JobApplication>) pipes();
    }
    
    public static JobApplicationPipeLineFactory<JobApplication, JobApplication> pipesJobApplication(Collection<JobApplication> items)
    {
        return REFERENCE_JobApplication.new JobApplicationPipeLineFactory<JobApplication, JobApplication> (items);
    }
    
    public static JobApplicationPipeLineFactory<JobApplication, JobApplication> pipesJobApplication(JobApplication[] _items)
    {
        return pipesJobApplication(Arrays.asList (_items));
    }
    
    public static JobApplicationPipeLineFactory<JobApplication, JobApplication> pipesJobApplication()
    {
        return pipesJobApplication((Collection)null);
    }
    
    
    public class JobApplicationPipeLineFactory<From extends BaseBusinessClass, Me extends JobApplication> extends BaseBusinessClass.ORMPipeLine<From, Me>    
    {
        public <Prev> JobApplicationPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
        {
            super (pipeLine, nextPipe);
        }
        
        public JobApplicationPipeLineFactory (From seed)
        {
            super(seed);
        }

        public JobApplicationPipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("AssessmentCriteriaAnswers"))
            {
                return toAssessmentCriteriaAnswers ();
            }                
            if (name.equals ("Notes"))
            {
                return toNotes ();
            }                
            if (name.equals ("ScheduledEmails"))
            {
                return toScheduledEmails ();
            }                
            if (name.equals ("SentEmails"))
            {
                return toSentEmails ();
            }                
            if (name.equals ("Messages"))
            {
                return toMessages ();
            }                
            if (name.equals ("AppProcessOption"))
            {
                return toAppProcessOption ();
            }                
            if (name.equals ("OverallRank"))
            {
                return toOverallRank ();
            }                
            if (name.equals ("RoleFit"))
            {
                return toRoleFit ();
            }                
            if (name.equals ("RequirementFit"))
            {
                return toRequirementFit ();
            }                
            if (name.equals ("CultureFit"))
            {
                return toCultureFit ();
            }                
            if (name.equals ("FactorScoreDetails"))
            {
                return toFactorScoreDetails ();
            }                
            if (name.equals ("Note"))
            {
                return toNote ();
            }                
            if (name.equals ("CV"))
            {
                return toCV ();
            }                
            if (name.equals ("CoverLetter"))
            {
                return toCoverLetter ();
            }                
            if (name.equals ("ApplicationStatus"))
            {
                return toApplicationStatus ();
            }                
            if (name.equals ("SubmittedDate"))
            {
                return toSubmittedDate ();
            }                
            if (name.equals ("GoogleAddressText"))
            {
                return toGoogleAddressText ();
            }                
            if (name.equals ("PreferRemote"))
            {
                return toPreferRemote ();
            }                
            if (name.equals ("HappyToRelocate"))
            {
                return toHappyToRelocate ();
            }                
            if (name.equals ("IsEmailIngest"))
            {
                return toIsEmailIngest ();
            }                
            if (name.equals ("ApplicantSource"))
            {
                return toApplicantSource ();
            }                
            if (name.equals ("Candidate"))
            {
                return toCandidate ();
            }                
            if (name.equals ("Job"))
            {
                return toJob ();
            }                
            if (name.equals ("WorkFlowStage"))
            {
                return toWorkFlowStage ();
            }                
            
            
            return super.to(name);
        }
        
        
        public AppProcessOption.AppProcessOptionPipeLineFactory<From, AppProcessOption> toAppProcessOption () 
        { 
            return new AppProcessOption.AppProcessOptionPipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_AppProcessOption));
        }
        
        public PipeLine<From, Integer> toOverallRank () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_OverallRank));  }
        
        public PipeLine<From, Map> toRoleFit () { return pipe(new ORMAttributePipe<Me, Map>(FIELD_RoleFit));  }
        
        public PipeLine<From, Map> toRequirementFit () { return pipe(new ORMAttributePipe<Me, Map>(FIELD_RequirementFit));  }
        
        public PipeLine<From, Map> toCultureFit () { return pipe(new ORMAttributePipe<Me, Map>(FIELD_CultureFit));  }
        
        public PipeLine<From, Map> toFactorScoreDetails () { return pipe(new ORMAttributePipe<Me, Map>(FIELD_FactorScoreDetails));  }
        
        public PipeLine<From, String> toNote () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Note));  }
        
        public PipeLine<From, BinaryContent> toCV () { return pipe(new ORMAttributePipe<Me, BinaryContent>(FIELD_CV));  }
        
        public PipeLine<From, BinaryContent> toCoverLetter () { return pipe(new ORMAttributePipe<Me, BinaryContent>(FIELD_CoverLetter));  }
        
        public ApplicationStatus.ApplicationStatusPipeLineFactory<From, ApplicationStatus> toApplicationStatus () 
        { 
            return new ApplicationStatus.ApplicationStatusPipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_ApplicationStatus));
        }
        
        public PipeLine<From, Date> toSubmittedDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_SubmittedDate));  }
        
        public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText));  }
        
        public PipeLine<From, Boolean> toPreferRemote () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PreferRemote));  }
        
        public PipeLine<From, Boolean> toHappyToRelocate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_HappyToRelocate));  }
        
        public PipeLine<From, Boolean> toIsEmailIngest () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsEmailIngest));  }
        
        public ApplicantSource.ApplicantSourcePipeLineFactory<From, ApplicantSource> toApplicantSource () 
        { 
            return new ApplicantSource.ApplicantSourcePipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_ApplicantSource));
        }

        public Candidate.CandidatePipeLineFactory<From, Candidate> toCandidate () { return toCandidate (Filter.ALL); }

        public Candidate.CandidatePipeLineFactory<From, Candidate> toCandidate (Filter<Candidate> filter) 
        { 
            return Candidate.REFERENCE_Candidate.new CandidatePipeLineFactory<From, Candidate> (this, new ORMSingleAssocPipe<Me, Candidate>(SINGLEREFERENCE_Candidate, filter)); 
        }

        public Job.JobPipeLineFactory<From, Job> toJob () { return toJob (Filter.ALL); }

        public Job.JobPipeLineFactory<From, Job> toJob (Filter<Job> filter) 
        { 
            return Job.REFERENCE_Job.new JobPipeLineFactory<From, Job> (this, new ORMSingleAssocPipe<Me, Job>(SINGLEREFERENCE_Job, filter)); 
        }

        public WorkFlowStage.WorkFlowStagePipeLineFactory<From, WorkFlowStage> toWorkFlowStage () { return toWorkFlowStage (Filter.ALL); }

        public WorkFlowStage.WorkFlowStagePipeLineFactory<From, WorkFlowStage> toWorkFlowStage (Filter<WorkFlowStage> filter) 
        { 
            return WorkFlowStage.REFERENCE_WorkFlowStage.new WorkFlowStagePipeLineFactory<From, WorkFlowStage> (this, new ORMSingleAssocPipe<Me, WorkFlowStage>(SINGLEREFERENCE_WorkFlowStage, filter)); 
        }

        public AssessmentCriteriaAnswer.AssessmentCriteriaAnswerPipeLineFactory<From, AssessmentCriteriaAnswer> toAssessmentCriteriaAnswers () { return toAssessmentCriteriaAnswers(Filter.ALL); }        

        public AssessmentCriteriaAnswer.AssessmentCriteriaAnswerPipeLineFactory<From, AssessmentCriteriaAnswer> toAssessmentCriteriaAnswers (Filter<AssessmentCriteriaAnswer> filter)
        {
            return AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer.new AssessmentCriteriaAnswerPipeLineFactory<From, AssessmentCriteriaAnswer> (this, new ORMMultiAssocPipe<Me, AssessmentCriteriaAnswer>(MULTIPLEREFERENCE_AssessmentCriteriaAnswers, filter)); 
        }

        public Note.NotePipeLineFactory<From, Note> toNotes () { return toNotes(Filter.ALL); }        

        public Note.NotePipeLineFactory<From, Note> toNotes (Filter<Note> filter)
        {
            return Note.REFERENCE_Note.new NotePipeLineFactory<From, Note> (this, new ORMMultiAssocPipe<Me, Note>(MULTIPLEREFERENCE_Notes, filter)); 
        }

        public ScheduledEmail.ScheduledEmailPipeLineFactory<From, ScheduledEmail> toScheduledEmails () { return toScheduledEmails(Filter.ALL); }        

        public ScheduledEmail.ScheduledEmailPipeLineFactory<From, ScheduledEmail> toScheduledEmails (Filter<ScheduledEmail> filter)
        {
            return ScheduledEmail.REFERENCE_ScheduledEmail.new ScheduledEmailPipeLineFactory<From, ScheduledEmail> (this, new ORMMultiAssocPipe<Me, ScheduledEmail>(MULTIPLEREFERENCE_ScheduledEmails, filter)); 
        }

        public SentEmail.SentEmailPipeLineFactory<From, SentEmail> toSentEmails () { return toSentEmails(Filter.ALL); }        

        public SentEmail.SentEmailPipeLineFactory<From, SentEmail> toSentEmails (Filter<SentEmail> filter)
        {
            return SentEmail.REFERENCE_SentEmail.new SentEmailPipeLineFactory<From, SentEmail> (this, new ORMMultiAssocPipe<Me, SentEmail>(MULTIPLEREFERENCE_SentEmails, filter)); 
        }

        public Message.MessagePipeLineFactory<From, Message> toMessages () { return toMessages(Filter.ALL); }        

        public Message.MessagePipeLineFactory<From, Message> toMessages (Filter<Message> filter)
        {
            return Message.REFERENCE_Message.new MessagePipeLineFactory<From, Message> (this, new ORMMultiAssocPipe<Me, Message>(MULTIPLEREFERENCE_Messages, filter)); 
        }
    }
    
    public boolean isTransientAttrib(String attribName)
    {
        
        if(CollectionUtils.equals(attribName, "AppProcessOption"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "OverallRank"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "RoleFit"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "RequirementFit"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "CultureFit"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "FactorScoreDetails"))
        {
            return true;
        }
        
        if(CollectionUtils.equals(attribName, "Note"))
        {
            return true;
        }
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

class DummyJobApplication extends JobApplication
{
    // Default constructor primarily to support Externalisable
    public DummyJobApplication()
    {
        super();
    }

    public void assertValid ()
    {
    }


    public Candidate getCandidate () throws StorageException
    {
        return (Candidate)(Candidate.DUMMY_Candidate);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getCandidateID ()
    {
        return Candidate.DUMMY_Candidate.getObjectID();
    }

    public Job getJob () throws StorageException
    {
        return (Job)(Job.DUMMY_Job);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getJobID ()
    {
        return Job.DUMMY_Job.getObjectID();
    }

    public WorkFlowStage getWorkFlowStage () throws StorageException
    {
        return (WorkFlowStage)(WorkFlowStage.DUMMY_WorkFlowStage);
    }


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getWorkFlowStageID ()
    {
        return WorkFlowStage.DUMMY_WorkFlowStage.getObjectID();
    }

    public int getAssessmentCriteriaAnswersCount () throws StorageException
    {
        return 0;
    }


    public AssessmentCriteriaAnswer getAssessmentCriteriaAnswersAt (int index) throws StorageException
    {
        throw new RuntimeException ("No elements in a dummy object in association AssessmentCriteriaAnswers");
    }


    public SortedSet getAssessmentCriteriaAnswersSet () throws StorageException
    {
        return new TreeSet();
    }

    public int getNotesCount () throws StorageException
    {
        return 0;
    }


    public Note getNotesAt (int index) throws StorageException
    {
        throw new RuntimeException ("No elements in a dummy object in association Notes");
    }


    public SortedSet getNotesSet () throws StorageException
    {
        return new TreeSet();
    }

    public int getScheduledEmailsCount () throws StorageException
    {
        return 0;
    }


    public ScheduledEmail getScheduledEmailsAt (int index) throws StorageException
    {
        throw new RuntimeException ("No elements in a dummy object in association ScheduledEmails");
    }


    public SortedSet getScheduledEmailsSet () throws StorageException
    {
        return new TreeSet();
    }

    public int getSentEmailsCount () throws StorageException
    {
        return 0;
    }


    public SentEmail getSentEmailsAt (int index) throws StorageException
    {
        throw new RuntimeException ("No elements in a dummy object in association SentEmails");
    }


    public SortedSet getSentEmailsSet () throws StorageException
    {
        return new TreeSet();
    }

    public int getMessagesCount () throws StorageException
    {
        return 0;
    }


    public Message getMessagesAt (int index) throws StorageException
    {
        throw new RuntimeException ("No elements in a dummy object in association Messages");
    }


    public SortedSet getMessagesSet () throws StorageException
    {
        return new TreeSet();
    }

}

    
