/*
 * IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
 * Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
 *
 *   Version: 1.0
 *   Vendor: Apache Software Foundation (Xalan XSLTC)
 *   Vendor URL: http://xml.apache.org/xalan-j
 */


    package performa.orm;

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



public abstract class BaseCandidate extends BaseBusinessClass
{
    // Reference instance for the object
    public static final Candidate REFERENCE_Candidate = new Candidate ();

    // Reference instance for the object
    public static final Candidate DUMMY_Candidate = new DummyCandidate ();

    // Static constants corresponding to field names
    
    public static final String FIELD_FirstName = "FirstName";
    public static final String FIELD_MiddleName = "MiddleName";
    public static final String FIELD_LastName = "LastName";
    public static final String FIELD_PreferredName = "PreferredName";
    public static final String FIELD_Salutation = "Salutation";
    public static final String FIELD_Position = "Position";
    public static final String FIELD_DateOfBirth = "DateOfBirth";
    public static final String FIELD_DateRegistered = "DateRegistered";
    public static final String FIELD_Gender = "Gender";
    public static final String FIELD_Password = "Password";
    public static final String FIELD_DateTaken = "DateTaken";
    public static final String FIELD_Location = "Location";
    public static final String FIELD_Phone = "Phone";
    public static final String FIELD_Email = "Email";

    // Static constants corresponding to searches
    

    // Static constants corresponding to attribute helpers
    private static final DefaultAttributeHelper<Candidate> HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_MiddleName = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_LastName = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_PreferredName = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Salutation = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Position = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_DateOfBirth = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_DateRegistered = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Gender = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Password = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_DateTaken = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Location = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Candidate> HELPER_Email = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private String _FirstName;
    private String _MiddleName;
    private String _LastName;
    private String _PreferredName;
    private String _Salutation;
    private String _Position;
    private Date _DateOfBirth;
    private Date _DateRegistered;
    private String _Gender;
    private String _Password;
    private Date _DateTaken;
    private String _Location;
    private String _Phone;
    private String _Email;
    

    // Private attributes corresponding to single references
    

    // Private attributes corresponding to multiple references
    

    // Map of maps of metadata
    private static final Map ATTRIBUTES_METADATA_Candidate = new HashMap ();

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_FirstName_Validators;
    private static final AttributeValidator[] FIELD_MiddleName_Validators;
    private static final AttributeValidator[] FIELD_LastName_Validators;
    private static final AttributeValidator[] FIELD_PreferredName_Validators;
    private static final AttributeValidator[] FIELD_Salutation_Validators;
    private static final AttributeValidator[] FIELD_Position_Validators;
    private static final AttributeValidator[] FIELD_DateOfBirth_Validators;
    private static final AttributeValidator[] FIELD_DateRegistered_Validators;
    private static final AttributeValidator[] FIELD_Gender_Validators;
    private static final AttributeValidator[] FIELD_Password_Validators;
    private static final AttributeValidator[] FIELD_DateTaken_Validators;
    private static final AttributeValidator[] FIELD_Location_Validators;
    private static final AttributeValidator[] FIELD_Phone_Validators;
    private static final AttributeValidator[] FIELD_Email_Validators;
    

    // Arrays of behaviour decorators
    private static final CandidateBehaviourDecorator[] Candidate_BehaviourDecorators;
    
    static
    {
        try
        {
            
            
            Map  validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));

            FIELD_FirstName_Validators = (AttributeValidator[])setupAttribMetaData_FirstName(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_MiddleName_Validators = (AttributeValidator[])setupAttribMetaData_MiddleName(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_LastName_Validators = (AttributeValidator[])setupAttribMetaData_LastName(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_PreferredName_Validators = (AttributeValidator[])setupAttribMetaData_PreferredName(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Salutation_Validators = (AttributeValidator[])setupAttribMetaData_Salutation(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Position_Validators = (AttributeValidator[])setupAttribMetaData_Position(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DateOfBirth_Validators = (AttributeValidator[])setupAttribMetaData_DateOfBirth(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DateRegistered_Validators = (AttributeValidator[])setupAttribMetaData_DateRegistered(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Gender_Validators = (AttributeValidator[])setupAttribMetaData_Gender(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DateTaken_Validators = (AttributeValidator[])setupAttribMetaData_DateTaken(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Location_Validators = (AttributeValidator[])setupAttribMetaData_Location(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
            

            REFERENCE_Candidate.initialiseReference ();
            DUMMY_Candidate.initialiseReference ();
            Candidate_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(Candidate.class).toArray(new CandidateBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

    
    // Meta Info setup
    private static List setupAttribMetaData_FirstName(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "first_name");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "FirstName");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.FirstName:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_FirstName, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_MiddleName(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "middle_name");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "MiddleName");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.MiddleName:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_MiddleName, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_LastName(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "last_name");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "LastName");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.LastName:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_LastName, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_PreferredName(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "preferred_name");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "PreferredName");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.PreferredName:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_PreferredName, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Salutation(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "salutation");
        metaInfo.put ("length", "10");
        metaInfo.put ("name", "Salutation");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Salutation:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Salutation, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Position(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "position");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "Position");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Position:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Position, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_DateOfBirth(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "date_of_birth");
        metaInfo.put ("name", "DateOfBirth");
        metaInfo.put ("type", "Date");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.DateOfBirth:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_DateOfBirth, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_DateRegistered(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "date_registered");
        metaInfo.put ("name", "DateRegistered");
        metaInfo.put ("type", "Date");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.DateRegistered:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_DateRegistered, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Gender(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "gender");
        metaInfo.put ("length", "10");
        metaInfo.put ("name", "Gender");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Gender:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Gender, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Password(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "password");
        metaInfo.put ("length", "15");
        metaInfo.put ("name", "Password");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Password:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Password, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_DateTaken(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "date_taken");
        metaInfo.put ("name", "DateTaken");
        metaInfo.put ("type", "Date");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.DateTaken:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_DateTaken, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Location(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "location");
        metaInfo.put ("length", "80");
        metaInfo.put ("name", "Location");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Location:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Location, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Phone(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "contact_phone");
        metaInfo.put ("length", "80");
        metaInfo.put ("name", "Phone");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Phone:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Phone, Collections.unmodifiableMap (metaInfo));

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

        return validators;
    }
    
    // Meta Info setup
    private static List setupAttribMetaData_Email(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("dbcol", "email");
        metaInfo.put ("length", "60");
        metaInfo.put ("name", "Email");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Email:", metaInfo);
        ATTRIBUTES_METADATA_Candidate.put (FIELD_Email, Collections.unmodifiableMap (metaInfo));

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

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


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


    


    // Initialise the attributes
    protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
    {
        super._initialiseNewObjAttributes (transaction);

        
        _FirstName = (String)(HELPER_FirstName.initialise (_FirstName));
        _MiddleName = (String)(HELPER_MiddleName.initialise (_MiddleName));
        _LastName = (String)(HELPER_LastName.initialise (_LastName));
        _PreferredName = (String)(HELPER_PreferredName.initialise (_PreferredName));
        _Salutation = (String)(HELPER_Salutation.initialise (_Salutation));
        _Position = (String)(HELPER_Position.initialise (_Position));
        _DateOfBirth = (Date)(HELPER_DateOfBirth.initialise (_DateOfBirth));
        _DateRegistered = (Date)(HELPER_DateRegistered.initialise (_DateRegistered));
        _Gender = (String)(HELPER_Gender.initialise (_Gender));
        _Password = (String)(HELPER_Password.initialise (_Password));
        _DateTaken = (Date)(HELPER_DateTaken.initialise (_DateTaken));
        _Location = (String)(HELPER_Location.initialise (_Location));
        _Phone = (String)(HELPER_Phone.initialise (_Phone));
        _Email = (String)(HELPER_Email.initialise (_Email));
    }


    // Initialise the associations
    protected void _initialiseAssociations ()
    {
        super._initialiseAssociations ();

        
    }


    // Initialise the associations
    protected BaseBusinessClass initialiseReference ()
    {
        super.initialiseReference ();
        
        
        
        return this;
    }

    

    /**
     * Get the attribute FirstName
     */
    public String getFirstName ()
    {
        assertValid();
        String valToReturn = _FirstName;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getFirstName ((Candidate)this, valToReturn);
            }
            
            return valToReturn;
        
    }


    /**
     * Called prior to the attribute changing.  Subclasses need not call super.  If a field exception
     * is thrown, the attribute change will fail.  The new value is different to the old value.
     */
    protected void preFirstNameChange (String newFirstName) throws FieldException
    {
    }


    /**
     * Called after the attribute changes.
     * If a field exception is thrown, the value is still changed, however it 
     * may lead to the TX being rolled back
     */
    protected void postFirstNameChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute FirstName.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setFirstName (String newFirstName) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newFirstName = bhd.setFirstName ((Candidate)this, newFirstName);
                oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
            }

            

            if (FIELD_FirstName_Validators.length > 0)
            {
                Object newFirstNameObj = HELPER_FirstName.toObject (newFirstName);

                if (newFirstNameObj != null)
                {
                    int     loopMax = FIELD_FirstName_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_FirstName);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_FirstName () != FieldWriteability.FALSE, "Field  FirstName is not writeable");
            preFirstNameChange (newFirstName);
            markFieldChange (FIELD_FirstName);
            _FirstName = newFirstName;            
            postFieldChange (FIELD_FirstName);
            postFirstNameChange ();
        }
    }

    /**
     * Get the attribute MiddleName
     */
    public String getMiddleName ()
    {
        assertValid();
        String valToReturn = _MiddleName;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getMiddleName ((Candidate)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 preMiddleNameChange (String newMiddleName) 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 postMiddleNameChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MiddleName.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMiddleName (String newMiddleName) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MiddleName.compare (_MiddleName, newMiddleName);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newMiddleName = bhd.setMiddleName ((Candidate)this, newMiddleName);
                oldAndNewIdentical = HELPER_MiddleName.compare (_MiddleName, newMiddleName);
            }

            

            if (FIELD_MiddleName_Validators.length > 0)
            {
                Object newMiddleNameObj = HELPER_MiddleName.toObject (newMiddleName);

                if (newMiddleNameObj != null)
                {
                    int     loopMax = FIELD_MiddleName_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_MiddleName);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MiddleName () != FieldWriteability.FALSE, "Field  MiddleName is not writeable");
            preMiddleNameChange (newMiddleName);
            markFieldChange (FIELD_MiddleName);
            _MiddleName = newMiddleName;            
            postFieldChange (FIELD_MiddleName);
            postMiddleNameChange ();
        }
    }

    /**
     * Get the attribute LastName
     */
    public String getLastName ()
    {
        assertValid();
        String valToReturn = _LastName;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getLastName ((Candidate)this, valToReturn);
            }
            
            return valToReturn;
        
    }


    /**
     * Called prior to the attribute changing.  Subclasses need not call super.  If a field exception
     * is thrown, the attribute change will fail.  The new value is different to the old value.
     */
    protected void preLastNameChange (String newLastName) throws FieldException
    {
    }


    /**
     * Called after the attribute changes.
     * If a field exception is thrown, the value is still changed, however it 
     * may lead to the TX being rolled back
     */
    protected void postLastNameChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute LastName.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setLastName (String newLastName) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newLastName = bhd.setLastName ((Candidate)this, newLastName);
                oldAndNewIdentical = HELPER_LastName.compare (_LastName, newLastName);
            }

            

            if (FIELD_LastName_Validators.length > 0)
            {
                Object newLastNameObj = HELPER_LastName.toObject (newLastName);

                if (newLastNameObj != null)
                {
                    int     loopMax = FIELD_LastName_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_LastName);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_LastName () != FieldWriteability.FALSE, "Field  LastName is not writeable");
            preLastNameChange (newLastName);
            markFieldChange (FIELD_LastName);
            _LastName = newLastName;            
            postFieldChange (FIELD_LastName);
            postLastNameChange ();
        }
    }

    /**
     * Get the attribute PreferredName
     */
    public String getPreferredName ()
    {
        assertValid();
        String valToReturn = _PreferredName;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getPreferredName ((Candidate)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 prePreferredNameChange (String newPreferredName) 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 postPreferredNameChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute PreferredName.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setPreferredName (String newPreferredName) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_PreferredName.compare (_PreferredName, newPreferredName);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newPreferredName = bhd.setPreferredName ((Candidate)this, newPreferredName);
                oldAndNewIdentical = HELPER_PreferredName.compare (_PreferredName, newPreferredName);
            }

            

            if (FIELD_PreferredName_Validators.length > 0)
            {
                Object newPreferredNameObj = HELPER_PreferredName.toObject (newPreferredName);

                if (newPreferredNameObj != null)
                {
                    int     loopMax = FIELD_PreferredName_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_PreferredName);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_PreferredName () != FieldWriteability.FALSE, "Field  PreferredName is not writeable");
            prePreferredNameChange (newPreferredName);
            markFieldChange (FIELD_PreferredName);
            _PreferredName = newPreferredName;            
            postFieldChange (FIELD_PreferredName);
            postPreferredNameChange ();
        }
    }

    /**
     * Get the attribute Salutation
     */
    public String getSalutation ()
    {
        assertValid();
        String valToReturn = _Salutation;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getSalutation ((Candidate)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 preSalutationChange (String newSalutation) 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 postSalutationChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Salutation.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setSalutation (String newSalutation) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Salutation.compare (_Salutation, newSalutation);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newSalutation = bhd.setSalutation ((Candidate)this, newSalutation);
                oldAndNewIdentical = HELPER_Salutation.compare (_Salutation, newSalutation);
            }

            

            if (FIELD_Salutation_Validators.length > 0)
            {
                Object newSalutationObj = HELPER_Salutation.toObject (newSalutation);

                if (newSalutationObj != null)
                {
                    int     loopMax = FIELD_Salutation_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Salutation);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Salutation () != FieldWriteability.FALSE, "Field  Salutation is not writeable");
            preSalutationChange (newSalutation);
            markFieldChange (FIELD_Salutation);
            _Salutation = newSalutation;            
            postFieldChange (FIELD_Salutation);
            postSalutationChange ();
        }
    }

    /**
     * Get the attribute Position
     */
    public String getPosition ()
    {
        assertValid();
        String valToReturn = _Position;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getPosition ((Candidate)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 prePositionChange (String newPosition) 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 postPositionChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Position.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setPosition (String newPosition) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Position.compare (_Position, newPosition);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newPosition = bhd.setPosition ((Candidate)this, newPosition);
                oldAndNewIdentical = HELPER_Position.compare (_Position, newPosition);
            }

            

            if (FIELD_Position_Validators.length > 0)
            {
                Object newPositionObj = HELPER_Position.toObject (newPosition);

                if (newPositionObj != null)
                {
                    int     loopMax = FIELD_Position_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Position);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Position () != FieldWriteability.FALSE, "Field  Position is not writeable");
            prePositionChange (newPosition);
            markFieldChange (FIELD_Position);
            _Position = newPosition;            
            postFieldChange (FIELD_Position);
            postPositionChange ();
        }
    }

    /**
     * Get the attribute DateOfBirth
     */
    public Date getDateOfBirth ()
    {
        assertValid();
        Date valToReturn = _DateOfBirth;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getDateOfBirth ((Candidate)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 preDateOfBirthChange (Date newDateOfBirth) 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 postDateOfBirthChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DateOfBirth.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDateOfBirth (Date newDateOfBirth) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DateOfBirth.compare (_DateOfBirth, newDateOfBirth);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newDateOfBirth = bhd.setDateOfBirth ((Candidate)this, newDateOfBirth);
                oldAndNewIdentical = HELPER_DateOfBirth.compare (_DateOfBirth, newDateOfBirth);
            }

            

            if (FIELD_DateOfBirth_Validators.length > 0)
            {
                Object newDateOfBirthObj = HELPER_DateOfBirth.toObject (newDateOfBirth);

                if (newDateOfBirthObj != null)
                {
                    int     loopMax = FIELD_DateOfBirth_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_DateOfBirth);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DateOfBirth () != FieldWriteability.FALSE, "Field  DateOfBirth is not writeable");
            preDateOfBirthChange (newDateOfBirth);
            markFieldChange (FIELD_DateOfBirth);
            _DateOfBirth = newDateOfBirth;            
            postFieldChange (FIELD_DateOfBirth);
            postDateOfBirthChange ();
        }
    }

    /**
     * Get the attribute DateRegistered
     */
    public Date getDateRegistered ()
    {
        assertValid();
        Date valToReturn = _DateRegistered;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getDateRegistered ((Candidate)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 preDateRegisteredChange (Date newDateRegistered) 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 postDateRegisteredChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DateRegistered.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDateRegistered (Date newDateRegistered) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DateRegistered.compare (_DateRegistered, newDateRegistered);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newDateRegistered = bhd.setDateRegistered ((Candidate)this, newDateRegistered);
                oldAndNewIdentical = HELPER_DateRegistered.compare (_DateRegistered, newDateRegistered);
            }

            

            if (FIELD_DateRegistered_Validators.length > 0)
            {
                Object newDateRegisteredObj = HELPER_DateRegistered.toObject (newDateRegistered);

                if (newDateRegisteredObj != null)
                {
                    int     loopMax = FIELD_DateRegistered_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_DateRegistered);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DateRegistered () != FieldWriteability.FALSE, "Field  DateRegistered is not writeable");
            preDateRegisteredChange (newDateRegistered);
            markFieldChange (FIELD_DateRegistered);
            _DateRegistered = newDateRegistered;            
            postFieldChange (FIELD_DateRegistered);
            postDateRegisteredChange ();
        }
    }

    /**
     * Get the attribute Gender
     */
    public String getGender ()
    {
        assertValid();
        String valToReturn = _Gender;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getGender ((Candidate)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 preGenderChange (String newGender) 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 postGenderChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Gender.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setGender (String newGender) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Gender.compare (_Gender, newGender);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newGender = bhd.setGender ((Candidate)this, newGender);
                oldAndNewIdentical = HELPER_Gender.compare (_Gender, newGender);
            }

            

            if (FIELD_Gender_Validators.length > 0)
            {
                Object newGenderObj = HELPER_Gender.toObject (newGender);

                if (newGenderObj != null)
                {
                    int     loopMax = FIELD_Gender_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Gender);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Gender () != FieldWriteability.FALSE, "Field  Gender is not writeable");
            preGenderChange (newGender);
            markFieldChange (FIELD_Gender);
            _Gender = newGender;            
            postFieldChange (FIELD_Gender);
            postGenderChange ();
        }
    }

    /**
     * Get the attribute Password
     */
    public String getPassword ()
    {
        assertValid();
        String valToReturn = _Password;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getPassword ((Candidate)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 prePasswordChange (String newPassword) 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 postPasswordChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Password.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setPassword (String newPassword) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Password.compare (_Password, newPassword);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newPassword = bhd.setPassword ((Candidate)this, newPassword);
                oldAndNewIdentical = HELPER_Password.compare (_Password, newPassword);
            }

            

            if (FIELD_Password_Validators.length > 0)
            {
                Object newPasswordObj = HELPER_Password.toObject (newPassword);

                if (newPasswordObj != null)
                {
                    int     loopMax = FIELD_Password_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Password);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Password () != FieldWriteability.FALSE, "Field  Password is not writeable");
            prePasswordChange (newPassword);
            markFieldChange (FIELD_Password);
            _Password = newPassword;            
            postFieldChange (FIELD_Password);
            postPasswordChange ();
        }
    }

    /**
     * Get the attribute DateTaken
     */
    public Date getDateTaken ()
    {
        assertValid();
        Date valToReturn = _DateTaken;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getDateTaken ((Candidate)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 preDateTakenChange (Date newDateTaken) 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 postDateTakenChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DateTaken.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDateTaken (Date newDateTaken) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DateTaken.compare (_DateTaken, newDateTaken);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newDateTaken = bhd.setDateTaken ((Candidate)this, newDateTaken);
                oldAndNewIdentical = HELPER_DateTaken.compare (_DateTaken, newDateTaken);
            }

            

            if (FIELD_DateTaken_Validators.length > 0)
            {
                Object newDateTakenObj = HELPER_DateTaken.toObject (newDateTaken);

                if (newDateTakenObj != null)
                {
                    int     loopMax = FIELD_DateTaken_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_DateTaken);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DateTaken () != FieldWriteability.FALSE, "Field  DateTaken is not writeable");
            preDateTakenChange (newDateTaken);
            markFieldChange (FIELD_DateTaken);
            _DateTaken = newDateTaken;            
            postFieldChange (FIELD_DateTaken);
            postDateTakenChange ();
        }
    }

    /**
     * Get the attribute Location
     */
    public String getLocation ()
    {
        assertValid();
        String valToReturn = _Location;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getLocation ((Candidate)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 preLocationChange (String newLocation) 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 postLocationChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Location.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setLocation (String newLocation) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Location.compare (_Location, newLocation);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newLocation = bhd.setLocation ((Candidate)this, newLocation);
                oldAndNewIdentical = HELPER_Location.compare (_Location, newLocation);
            }

            

            if (FIELD_Location_Validators.length > 0)
            {
                Object newLocationObj = HELPER_Location.toObject (newLocation);

                if (newLocationObj != null)
                {
                    int     loopMax = FIELD_Location_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Location);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Location () != FieldWriteability.FALSE, "Field  Location is not writeable");
            preLocationChange (newLocation);
            markFieldChange (FIELD_Location);
            _Location = newLocation;            
            postFieldChange (FIELD_Location);
            postLocationChange ();
        }
    }

    /**
     * Get the attribute Phone
     */
    public String getPhone ()
    {
        assertValid();
        String valToReturn = _Phone;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getPhone ((Candidate)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 prePhoneChange (String newPhone) 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 postPhoneChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Phone.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setPhone (String newPhone) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Phone.compare (_Phone, newPhone);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newPhone = bhd.setPhone ((Candidate)this, newPhone);
                oldAndNewIdentical = HELPER_Phone.compare (_Phone, newPhone);
            }

            

            if (FIELD_Phone_Validators.length > 0)
            {
                Object newPhoneObj = HELPER_Phone.toObject (newPhone);

                if (newPhoneObj != null)
                {
                    int     loopMax = FIELD_Phone_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Phone);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Phone () != FieldWriteability.FALSE, "Field  Phone is not writeable");
            prePhoneChange (newPhone);
            markFieldChange (FIELD_Phone);
            _Phone = newPhone;            
            postFieldChange (FIELD_Phone);
            postPhoneChange ();
        }
    }

    /**
     * Get the attribute Email
     */
    public String getEmail ()
    {
        assertValid();
        String valToReturn = _Email;

            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                valToReturn = bhd.getEmail ((Candidate)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 preEmailChange (String newEmail) 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 postEmailChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Email.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setEmail (String newEmail) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
        
        try
        {
            for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
            {
                newEmail = bhd.setEmail ((Candidate)this, newEmail);
                oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
            }

            

            if (FIELD_Email_Validators.length > 0)
            {
                Object newEmailObj = HELPER_Email.toObject (newEmail);

                if (newEmailObj != null)
                {
                    int     loopMax = FIELD_Email_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Email);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Email () != FieldWriteability.FALSE, "Field  Email is not writeable");
            preEmailChange (newEmail);
            markFieldChange (FIELD_Email);
            _Email = newEmail;            
            postFieldChange (FIELD_Email);
            postEmailChange ();
        }
    }



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

        

        return result;
    }
    
    
    public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            return super.getSingleAssocReferenceInstance (assocName);
        }
    }


    public String getSingleAssocBackReference(String assocName)
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            return super.getSingleAssocBackReference (assocName);
        }
    }
    
    
    public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            return super.getSingleAssoc (assocName);
        }
    }


    public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            return super.getSingleAssoc (assocName, getType);
        }
    }


    public Long getSingleAssocID (String assocName) throws StorageException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            return super.getSingleAssocID (assocName);
        }
    }


    public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        
        else
        {
            super.setSingleAssoc (assocName, newValue);
        }
    }



    /**
     * A list of multi assoc names e.g. list of strings.
     */
    public List<String> getMultiAssocs()
    {
        List result = super.getMultiAssocs ();

        

        return result;
    }


    /**
     * Get the reference instance for the multi assoc name.
     */
    public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
    {
        

        return super.getMultiAssocReferenceInstance(attribName);
    }


    public String getMultiAssocBackReference(String attribName)
    {
        

        return super.getMultiAssocBackReference(attribName);
    }


    /**
     * Get the assoc count for the multi assoc name.
     */
    public int getMultiAssocCount(String attribName) throws StorageException
    {
        

        return super.getMultiAssocCount(attribName);
    }


    /**
     * Get the assoc at a particular index
     */
    public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
    {
        

        return super.getMultiAssocAt(attribName, index);
    }


    /**
     * Add to a multi assoc by attribute name
     */
    public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
    {
        

        super.addToMultiAssoc(attribName, newElement);
    }

    /**
     * Remove from a multi assoc by attribute name
     */
    public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
    {
        

        super.removeFromMultiAssoc(attribName, oldElement);
    }


    protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
    {
        

        super.__loadMultiAssoc(attribName, elements);
    }


    protected boolean __isMultiAssocLoaded (String attribName)
    {
        

        return super.__isMultiAssocLoaded(attribName);
    }

    



    public void onDelete ()
    {
        try 
        {
        }
        catch (Exception e)
        {
            throw NestedException.wrap(e);
        }

        super.onDelete ();
    }


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


    public Candidate referenceInstance ()
    {
        return REFERENCE_Candidate;
    }


    public Candidate getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getCandidateByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_Candidate;
    }


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





    /**
     * 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   candidatePSet = allSets.getPersistentSet (myID, "candidate", myPSetStatus);

        candidatePSet.setAttrib (FIELD_ObjectID, myID);
        candidatePSet.setAttrib (FIELD_FirstName, HELPER_FirstName.toObject (_FirstName)); //
        candidatePSet.setAttrib (FIELD_MiddleName, HELPER_MiddleName.toObject (_MiddleName)); //
        candidatePSet.setAttrib (FIELD_LastName, HELPER_LastName.toObject (_LastName)); //
        candidatePSet.setAttrib (FIELD_PreferredName, HELPER_PreferredName.toObject (_PreferredName)); //
        candidatePSet.setAttrib (FIELD_Salutation, HELPER_Salutation.toObject (_Salutation)); //
        candidatePSet.setAttrib (FIELD_Position, HELPER_Position.toObject (_Position)); //
        candidatePSet.setAttrib (FIELD_DateOfBirth, HELPER_DateOfBirth.toObject (_DateOfBirth)); //
        candidatePSet.setAttrib (FIELD_DateRegistered, HELPER_DateRegistered.toObject (_DateRegistered)); //
        candidatePSet.setAttrib (FIELD_Gender, HELPER_Gender.toObject (_Gender)); //
        candidatePSet.setAttrib (FIELD_Password, HELPER_Password.toObject (_Password)); //
        candidatePSet.setAttrib (FIELD_DateTaken, HELPER_DateTaken.toObject (_DateTaken)); //
        candidatePSet.setAttrib (FIELD_Location, HELPER_Location.toObject (_Location)); //
        candidatePSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); //
        candidatePSet.setAttrib (FIELD_Email, HELPER_Email.toObject (_Email)); //
        
    }


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

        
        PersistentSet   candidatePSet = allSets.getPersistentSet (objectID, "candidate");

        _FirstName = (String)(HELPER_FirstName.fromObject (_FirstName, candidatePSet.getAttrib (FIELD_FirstName))); //
        _MiddleName = (String)(HELPER_MiddleName.fromObject (_MiddleName, candidatePSet.getAttrib (FIELD_MiddleName))); //
        _LastName = (String)(HELPER_LastName.fromObject (_LastName, candidatePSet.getAttrib (FIELD_LastName))); //
        _PreferredName = (String)(HELPER_PreferredName.fromObject (_PreferredName, candidatePSet.getAttrib (FIELD_PreferredName))); //
        _Salutation = (String)(HELPER_Salutation.fromObject (_Salutation, candidatePSet.getAttrib (FIELD_Salutation))); //
        _Position = (String)(HELPER_Position.fromObject (_Position, candidatePSet.getAttrib (FIELD_Position))); //
        _DateOfBirth = (Date)(HELPER_DateOfBirth.fromObject (_DateOfBirth, candidatePSet.getAttrib (FIELD_DateOfBirth))); //
        _DateRegistered = (Date)(HELPER_DateRegistered.fromObject (_DateRegistered, candidatePSet.getAttrib (FIELD_DateRegistered))); //
        _Gender = (String)(HELPER_Gender.fromObject (_Gender, candidatePSet.getAttrib (FIELD_Gender))); //
        _Password = (String)(HELPER_Password.fromObject (_Password, candidatePSet.getAttrib (FIELD_Password))); //
        _DateTaken = (Date)(HELPER_DateTaken.fromObject (_DateTaken, candidatePSet.getAttrib (FIELD_DateTaken))); //
        _Location = (String)(HELPER_Location.fromObject (_Location, candidatePSet.getAttrib (FIELD_Location))); //
        _Phone = (String)(HELPER_Phone.fromObject (_Phone, candidatePSet.getAttrib (FIELD_Phone))); //
        _Email = (String)(HELPER_Email.fromObject (_Email, candidatePSet.getAttrib (FIELD_Email))); //
        
    }





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

        if (other instanceof Candidate)
        {
            Candidate otherCandidate = (Candidate)other;
            
            try
            {
                setFirstName (otherCandidate.getFirstName ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMiddleName (otherCandidate.getMiddleName ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLastName (otherCandidate.getLastName ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setPreferredName (otherCandidate.getPreferredName ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setSalutation (otherCandidate.getSalutation ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setPosition (otherCandidate.getPosition ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDateOfBirth (otherCandidate.getDateOfBirth ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDateRegistered (otherCandidate.getDateRegistered ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setGender (otherCandidate.getGender ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setPassword (otherCandidate.getPassword ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDateTaken (otherCandidate.getDateTaken ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLocation (otherCandidate.getLocation ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setPhone (otherCandidate.getPhone ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setEmail (otherCandidate.getEmail ());
            }
            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 BaseCandidate)
        {
            BaseCandidate sourceCandidate = (BaseCandidate)(source);

            _FirstName = sourceCandidate._FirstName;
            _MiddleName = sourceCandidate._MiddleName;
            _LastName = sourceCandidate._LastName;
            _PreferredName = sourceCandidate._PreferredName;
            _Salutation = sourceCandidate._Salutation;
            _Position = sourceCandidate._Position;
            _DateOfBirth = sourceCandidate._DateOfBirth;
            _DateRegistered = sourceCandidate._DateRegistered;
            _Gender = sourceCandidate._Gender;
            _Password = sourceCandidate._Password;
            _DateTaken = sourceCandidate._DateTaken;
            _Location = sourceCandidate._Location;
            _Phone = sourceCandidate._Phone;
            _Email = sourceCandidate._Email;
            
        }
    }


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

            
        }
    }


    /**
     * Set the associations in this to copies of the attributes in source.
     */
    public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
    {
        super.copyAssociationsFrom (source, linkToGhosts);

        if (source instanceof BaseCandidate)
        {
            BaseCandidate sourceCandidate = (BaseCandidate)(source);

            
        }
    }


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

        
    }


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

        _FirstName = (String)(HELPER_FirstName.readExternal (_FirstName, vals.get(FIELD_FirstName))); //
        _MiddleName = (String)(HELPER_MiddleName.readExternal (_MiddleName, vals.get(FIELD_MiddleName))); //
        _LastName = (String)(HELPER_LastName.readExternal (_LastName, vals.get(FIELD_LastName))); //
        _PreferredName = (String)(HELPER_PreferredName.readExternal (_PreferredName, vals.get(FIELD_PreferredName))); //
        _Salutation = (String)(HELPER_Salutation.readExternal (_Salutation, vals.get(FIELD_Salutation))); //
        _Position = (String)(HELPER_Position.readExternal (_Position, vals.get(FIELD_Position))); //
        _DateOfBirth = (Date)(HELPER_DateOfBirth.readExternal (_DateOfBirth, vals.get(FIELD_DateOfBirth))); //
        _DateRegistered = (Date)(HELPER_DateRegistered.readExternal (_DateRegistered, vals.get(FIELD_DateRegistered))); //
        _Gender = (String)(HELPER_Gender.readExternal (_Gender, vals.get(FIELD_Gender))); //
        _Password = (String)(HELPER_Password.readExternal (_Password, vals.get(FIELD_Password))); //
        _DateTaken = (Date)(HELPER_DateTaken.readExternal (_DateTaken, vals.get(FIELD_DateTaken))); //
        _Location = (String)(HELPER_Location.readExternal (_Location, vals.get(FIELD_Location))); //
        _Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); //
        _Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
        
    }


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

        vals.put (FIELD_FirstName, HELPER_FirstName.writeExternal (_FirstName));
        vals.put (FIELD_MiddleName, HELPER_MiddleName.writeExternal (_MiddleName));
        vals.put (FIELD_LastName, HELPER_LastName.writeExternal (_LastName));
        vals.put (FIELD_PreferredName, HELPER_PreferredName.writeExternal (_PreferredName));
        vals.put (FIELD_Salutation, HELPER_Salutation.writeExternal (_Salutation));
        vals.put (FIELD_Position, HELPER_Position.writeExternal (_Position));
        vals.put (FIELD_DateOfBirth, HELPER_DateOfBirth.writeExternal (_DateOfBirth));
        vals.put (FIELD_DateRegistered, HELPER_DateRegistered.writeExternal (_DateRegistered));
        vals.put (FIELD_Gender, HELPER_Gender.writeExternal (_Gender));
        vals.put (FIELD_Password, HELPER_Password.writeExternal (_Password));
        vals.put (FIELD_DateTaken, HELPER_DateTaken.writeExternal (_DateTaken));
        vals.put (FIELD_Location, HELPER_Location.writeExternal (_Location));
        vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone));
        vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
        
    }


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

        if (other instanceof BaseCandidate)
        {
            BaseCandidate otherCandidate = (BaseCandidate)(other);

            
            if (!HELPER_FirstName.compare(this._FirstName, otherCandidate._FirstName))
            {
                listener.notifyFieldChange(this, other, FIELD_FirstName, HELPER_FirstName.toObject(this._FirstName), HELPER_FirstName.toObject(otherCandidate._FirstName));
            }
            if (!HELPER_MiddleName.compare(this._MiddleName, otherCandidate._MiddleName))
            {
                listener.notifyFieldChange(this, other, FIELD_MiddleName, HELPER_MiddleName.toObject(this._MiddleName), HELPER_MiddleName.toObject(otherCandidate._MiddleName));
            }
            if (!HELPER_LastName.compare(this._LastName, otherCandidate._LastName))
            {
                listener.notifyFieldChange(this, other, FIELD_LastName, HELPER_LastName.toObject(this._LastName), HELPER_LastName.toObject(otherCandidate._LastName));
            }
            if (!HELPER_PreferredName.compare(this._PreferredName, otherCandidate._PreferredName))
            {
                listener.notifyFieldChange(this, other, FIELD_PreferredName, HELPER_PreferredName.toObject(this._PreferredName), HELPER_PreferredName.toObject(otherCandidate._PreferredName));
            }
            if (!HELPER_Salutation.compare(this._Salutation, otherCandidate._Salutation))
            {
                listener.notifyFieldChange(this, other, FIELD_Salutation, HELPER_Salutation.toObject(this._Salutation), HELPER_Salutation.toObject(otherCandidate._Salutation));
            }
            if (!HELPER_Position.compare(this._Position, otherCandidate._Position))
            {
                listener.notifyFieldChange(this, other, FIELD_Position, HELPER_Position.toObject(this._Position), HELPER_Position.toObject(otherCandidate._Position));
            }
            if (!HELPER_DateOfBirth.compare(this._DateOfBirth, otherCandidate._DateOfBirth))
            {
                listener.notifyFieldChange(this, other, FIELD_DateOfBirth, HELPER_DateOfBirth.toObject(this._DateOfBirth), HELPER_DateOfBirth.toObject(otherCandidate._DateOfBirth));
            }
            if (!HELPER_DateRegistered.compare(this._DateRegistered, otherCandidate._DateRegistered))
            {
                listener.notifyFieldChange(this, other, FIELD_DateRegistered, HELPER_DateRegistered.toObject(this._DateRegistered), HELPER_DateRegistered.toObject(otherCandidate._DateRegistered));
            }
            if (!HELPER_Gender.compare(this._Gender, otherCandidate._Gender))
            {
                listener.notifyFieldChange(this, other, FIELD_Gender, HELPER_Gender.toObject(this._Gender), HELPER_Gender.toObject(otherCandidate._Gender));
            }
            if (!HELPER_Password.compare(this._Password, otherCandidate._Password))
            {
                listener.notifyFieldChange(this, other, FIELD_Password, HELPER_Password.toObject(this._Password), HELPER_Password.toObject(otherCandidate._Password));
            }
            if (!HELPER_DateTaken.compare(this._DateTaken, otherCandidate._DateTaken))
            {
                listener.notifyFieldChange(this, other, FIELD_DateTaken, HELPER_DateTaken.toObject(this._DateTaken), HELPER_DateTaken.toObject(otherCandidate._DateTaken));
            }
            if (!HELPER_Location.compare(this._Location, otherCandidate._Location))
            {
                listener.notifyFieldChange(this, other, FIELD_Location, HELPER_Location.toObject(this._Location), HELPER_Location.toObject(otherCandidate._Location));
            }
            if (!HELPER_Phone.compare(this._Phone, otherCandidate._Phone))
            {
                listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone));
            }
            if (!HELPER_Email.compare(this._Email, otherCandidate._Email))
            {
                listener.notifyFieldChange(this, other, FIELD_Email, HELPER_Email.toObject(this._Email), HELPER_Email.toObject(otherCandidate._Email));
            }

            // Compare single assocs
            

            // Compare multiple assocs
            
        }
    }


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

        
    }


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

        visitor.visitField(this, FIELD_FirstName, HELPER_FirstName.toObject(getFirstName()));
        visitor.visitField(this, FIELD_MiddleName, HELPER_MiddleName.toObject(getMiddleName()));
        visitor.visitField(this, FIELD_LastName, HELPER_LastName.toObject(getLastName()));
        visitor.visitField(this, FIELD_PreferredName, HELPER_PreferredName.toObject(getPreferredName()));
        visitor.visitField(this, FIELD_Salutation, HELPER_Salutation.toObject(getSalutation()));
        visitor.visitField(this, FIELD_Position, HELPER_Position.toObject(getPosition()));
        visitor.visitField(this, FIELD_DateOfBirth, HELPER_DateOfBirth.toObject(getDateOfBirth()));
        visitor.visitField(this, FIELD_DateRegistered, HELPER_DateRegistered.toObject(getDateRegistered()));
        visitor.visitField(this, FIELD_Gender, HELPER_Gender.toObject(getGender()));
        visitor.visitField(this, FIELD_Password, HELPER_Password.toObject(getPassword()));
        visitor.visitField(this, FIELD_DateTaken, HELPER_DateTaken.toObject(getDateTaken()));
        visitor.visitField(this, FIELD_Location, HELPER_Location.toObject(getLocation()));
        visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone()));
        visitor.visitField(this, FIELD_Email, HELPER_Email.toObject(getEmail()));
        
    }


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

        
    }


    public static Candidate createCandidate (ObjectTransaction transaction) throws StorageException
    {
        Candidate     result = new Candidate ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static Candidate getCandidateByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (Candidate)(transaction.getObjectByID (REFERENCE_Candidate, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FirstName))
        {
            return filter.matches (getFirstName ());
        }
        else if (attribName.equals (FIELD_MiddleName))
        {
            return filter.matches (getMiddleName ());
        }
        else if (attribName.equals (FIELD_LastName))
        {
            return filter.matches (getLastName ());
        }
        else if (attribName.equals (FIELD_PreferredName))
        {
            return filter.matches (getPreferredName ());
        }
        else if (attribName.equals (FIELD_Salutation))
        {
            return filter.matches (getSalutation ());
        }
        else if (attribName.equals (FIELD_Position))
        {
            return filter.matches (getPosition ());
        }
        else if (attribName.equals (FIELD_DateOfBirth))
        {
            return filter.matches (getDateOfBirth ());
        }
        else if (attribName.equals (FIELD_DateRegistered))
        {
            return filter.matches (getDateRegistered ());
        }
        else if (attribName.equals (FIELD_Gender))
        {
            return filter.matches (getGender ());
        }
        else if (attribName.equals (FIELD_Password))
        {
            return filter.matches (getPassword ());
        }
        else if (attribName.equals (FIELD_DateTaken))
        {
            return filter.matches (getDateTaken ());
        }
        else if (attribName.equals (FIELD_Location))
        {
            return filter.matches (getLocation ());
        }
        else if (attribName.equals (FIELD_Phone))
        {
            return filter.matches (getPhone ());
        }
        else if (attribName.equals (FIELD_Email))
        {
            return filter.matches (getEmail ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }




    public Object getAttribute (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FirstName))
        {
            return HELPER_FirstName.toObject (getFirstName ());
        }
        else if (attribName.equals (FIELD_MiddleName))
        {
            return HELPER_MiddleName.toObject (getMiddleName ());
        }
        else if (attribName.equals (FIELD_LastName))
        {
            return HELPER_LastName.toObject (getLastName ());
        }
        else if (attribName.equals (FIELD_PreferredName))
        {
            return HELPER_PreferredName.toObject (getPreferredName ());
        }
        else if (attribName.equals (FIELD_Salutation))
        {
            return HELPER_Salutation.toObject (getSalutation ());
        }
        else if (attribName.equals (FIELD_Position))
        {
            return HELPER_Position.toObject (getPosition ());
        }
        else if (attribName.equals (FIELD_DateOfBirth))
        {
            return HELPER_DateOfBirth.toObject (getDateOfBirth ());
        }
        else if (attribName.equals (FIELD_DateRegistered))
        {
            return HELPER_DateRegistered.toObject (getDateRegistered ());
        }
        else if (attribName.equals (FIELD_Gender))
        {
            return HELPER_Gender.toObject (getGender ());
        }
        else if (attribName.equals (FIELD_Password))
        {
            return HELPER_Password.toObject (getPassword ());
        }
        else if (attribName.equals (FIELD_DateTaken))
        {
            return HELPER_DateTaken.toObject (getDateTaken ());
        }
        else if (attribName.equals (FIELD_Location))
        {
            return HELPER_Location.toObject (getLocation ());
        }
        else if (attribName.equals (FIELD_Phone))
        {
            return HELPER_Phone.toObject (getPhone ());
        }
        else if (attribName.equals (FIELD_Email))
        {
            return HELPER_Email.toObject (getEmail ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FirstName))
        {
            return HELPER_FirstName;
        }
        else if (attribName.equals (FIELD_MiddleName))
        {
            return HELPER_MiddleName;
        }
        else if (attribName.equals (FIELD_LastName))
        {
            return HELPER_LastName;
        }
        else if (attribName.equals (FIELD_PreferredName))
        {
            return HELPER_PreferredName;
        }
        else if (attribName.equals (FIELD_Salutation))
        {
            return HELPER_Salutation;
        }
        else if (attribName.equals (FIELD_Position))
        {
            return HELPER_Position;
        }
        else if (attribName.equals (FIELD_DateOfBirth))
        {
            return HELPER_DateOfBirth;
        }
        else if (attribName.equals (FIELD_DateRegistered))
        {
            return HELPER_DateRegistered;
        }
        else if (attribName.equals (FIELD_Gender))
        {
            return HELPER_Gender;
        }
        else if (attribName.equals (FIELD_Password))
        {
            return HELPER_Password;
        }
        else if (attribName.equals (FIELD_DateTaken))
        {
            return HELPER_DateTaken;
        }
        else if (attribName.equals (FIELD_Location))
        {
            return HELPER_Location;
        }
        else if (attribName.equals (FIELD_Phone))
        {
            return HELPER_Phone;
        }
        else if (attribName.equals (FIELD_Email))
        {
            return HELPER_Email;
        }
        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_FirstName))
        {
            setFirstName ((String)(HELPER_FirstName.fromObject (_FirstName, attribValue)));            
        }
        else if (attribName.equals (FIELD_MiddleName))
        {
            setMiddleName ((String)(HELPER_MiddleName.fromObject (_MiddleName, attribValue)));            
        }
        else if (attribName.equals (FIELD_LastName))
        {
            setLastName ((String)(HELPER_LastName.fromObject (_LastName, attribValue)));            
        }
        else if (attribName.equals (FIELD_PreferredName))
        {
            setPreferredName ((String)(HELPER_PreferredName.fromObject (_PreferredName, attribValue)));            
        }
        else if (attribName.equals (FIELD_Salutation))
        {
            setSalutation ((String)(HELPER_Salutation.fromObject (_Salutation, attribValue)));            
        }
        else if (attribName.equals (FIELD_Position))
        {
            setPosition ((String)(HELPER_Position.fromObject (_Position, attribValue)));            
        }
        else if (attribName.equals (FIELD_DateOfBirth))
        {
            setDateOfBirth ((Date)(HELPER_DateOfBirth.fromObject (_DateOfBirth, attribValue)));            
        }
        else if (attribName.equals (FIELD_DateRegistered))
        {
            setDateRegistered ((Date)(HELPER_DateRegistered.fromObject (_DateRegistered, attribValue)));            
        }
        else if (attribName.equals (FIELD_Gender))
        {
            setGender ((String)(HELPER_Gender.fromObject (_Gender, attribValue)));            
        }
        else if (attribName.equals (FIELD_Password))
        {
            setPassword ((String)(HELPER_Password.fromObject (_Password, attribValue)));            
        }
        else if (attribName.equals (FIELD_DateTaken))
        {
            setDateTaken ((Date)(HELPER_DateTaken.fromObject (_DateTaken, attribValue)));            
        }
        else if (attribName.equals (FIELD_Location))
        {
            setLocation ((String)(HELPER_Location.fromObject (_Location, attribValue)));            
        }
        else if (attribName.equals (FIELD_Phone))
        {
            setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue)));            
        }
        else if (attribName.equals (FIELD_Email))
        {
            setEmail ((String)(HELPER_Email.fromObject (_Email, attribValue)));            
        }
        else
        {
            super.setAttribute (attribName, attribValue);
        }
    }



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


    public FieldWriteability getWriteable (String fieldName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (fieldName.equals (FIELD_FirstName))
        {
            return getWriteability_FirstName ();
        }
        else if (fieldName.equals (FIELD_MiddleName))
        {
            return getWriteability_MiddleName ();
        }
        else if (fieldName.equals (FIELD_LastName))
        {
            return getWriteability_LastName ();
        }
        else if (fieldName.equals (FIELD_PreferredName))
        {
            return getWriteability_PreferredName ();
        }
        else if (fieldName.equals (FIELD_Salutation))
        {
            return getWriteability_Salutation ();
        }
        else if (fieldName.equals (FIELD_Position))
        {
            return getWriteability_Position ();
        }
        else if (fieldName.equals (FIELD_DateOfBirth))
        {
            return getWriteability_DateOfBirth ();
        }
        else if (fieldName.equals (FIELD_DateRegistered))
        {
            return getWriteability_DateRegistered ();
        }
        else if (fieldName.equals (FIELD_Gender))
        {
            return getWriteability_Gender ();
        }
        else if (fieldName.equals (FIELD_Password))
        {
            return getWriteability_Password ();
        }
        else if (fieldName.equals (FIELD_DateTaken))
        {
            return getWriteability_DateTaken ();
        }
        else if (fieldName.equals (FIELD_Location))
        {
            return getWriteability_Location ();
        }
        else if (fieldName.equals (FIELD_Phone))
        {
            return getWriteability_Phone ();
        }
        else if (fieldName.equals (FIELD_Email))
        {
            return getWriteability_Email ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        
            if (getWriteability_FirstName () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_FirstName);
            }
        
            if (getWriteability_MiddleName () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MiddleName);
            }
        
            if (getWriteability_LastName () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_LastName);
            }
        
            if (getWriteability_PreferredName () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_PreferredName);
            }
        
            if (getWriteability_Salutation () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Salutation);
            }
        
            if (getWriteability_Position () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Position);
            }
        
            if (getWriteability_DateOfBirth () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DateOfBirth);
            }
        
            if (getWriteability_DateRegistered () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DateRegistered);
            }
        
            if (getWriteability_Gender () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Gender);
            }
        
            if (getWriteability_Password () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Password);
            }
        
            if (getWriteability_DateTaken () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DateTaken);
            }
        
            if (getWriteability_Location () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Location);
            }
        
            if (getWriteability_Phone () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Phone);
            }
        
            if (getWriteability_Email () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Email);
            }
        

        super.putUnwriteable (fields);
    }

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

        
        result.add(HELPER_FirstName.getAttribObject (getClass (), _FirstName, false, FIELD_FirstName));
        result.add(HELPER_MiddleName.getAttribObject (getClass (), _MiddleName, false, FIELD_MiddleName));
        result.add(HELPER_LastName.getAttribObject (getClass (), _LastName, false, FIELD_LastName));
        result.add(HELPER_PreferredName.getAttribObject (getClass (), _PreferredName, false, FIELD_PreferredName));
        result.add(HELPER_Salutation.getAttribObject (getClass (), _Salutation, false, FIELD_Salutation));
        result.add(HELPER_Position.getAttribObject (getClass (), _Position, false, FIELD_Position));
        result.add(HELPER_DateOfBirth.getAttribObject (getClass (), _DateOfBirth, false, FIELD_DateOfBirth));
        result.add(HELPER_DateRegistered.getAttribObject (getClass (), _DateRegistered, false, FIELD_DateRegistered));
        result.add(HELPER_Gender.getAttribObject (getClass (), _Gender, false, FIELD_Gender));
        result.add(HELPER_Password.getAttribObject (getClass (), _Password, false, FIELD_Password));
        result.add(HELPER_DateTaken.getAttribObject (getClass (), _DateTaken, false, FIELD_DateTaken));
        result.add(HELPER_Location.getAttribObject (getClass (), _Location, false, FIELD_Location));
        result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone));
        result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));

        return result;
    }


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


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

    public void preCommit (boolean willBeStored) throws Exception
    {
        super.preCommit(willBeStored);
        
        if(willBeStored)
        {
        
        }
    }

    public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
    {
        
        
        return super.getBinaryContentHandler(attribName);
    }

    public static class CandidateBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<Candidate>
    {

    /**
     * Get the attribute FirstName
     */
    public String getFirstName (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute FirstName.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setFirstName (Candidate obj, String newFirstName) throws FieldException
    {
        return newFirstName;
    }

    /**
     * Get the attribute MiddleName
     */
    public String getMiddleName (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MiddleName.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setMiddleName (Candidate obj, String newMiddleName) throws FieldException
    {
        return newMiddleName;
    }

    /**
     * Get the attribute LastName
     */
    public String getLastName (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute LastName.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setLastName (Candidate obj, String newLastName) throws FieldException
    {
        return newLastName;
    }

    /**
     * Get the attribute PreferredName
     */
    public String getPreferredName (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute PreferredName.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setPreferredName (Candidate obj, String newPreferredName) throws FieldException
    {
        return newPreferredName;
    }

    /**
     * Get the attribute Salutation
     */
    public String getSalutation (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Salutation.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setSalutation (Candidate obj, String newSalutation) throws FieldException
    {
        return newSalutation;
    }

    /**
     * Get the attribute Position
     */
    public String getPosition (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Position.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setPosition (Candidate obj, String newPosition) throws FieldException
    {
        return newPosition;
    }

    /**
     * Get the attribute DateOfBirth
     */
    public Date getDateOfBirth (Candidate obj, Date original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DateOfBirth.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Date setDateOfBirth (Candidate obj, Date newDateOfBirth) throws FieldException
    {
        return newDateOfBirth;
    }

    /**
     * Get the attribute DateRegistered
     */
    public Date getDateRegistered (Candidate obj, Date original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DateRegistered.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Date setDateRegistered (Candidate obj, Date newDateRegistered) throws FieldException
    {
        return newDateRegistered;
    }

    /**
     * Get the attribute Gender
     */
    public String getGender (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Gender.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setGender (Candidate obj, String newGender) throws FieldException
    {
        return newGender;
    }

    /**
     * Get the attribute Password
     */
    public String getPassword (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Password.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setPassword (Candidate obj, String newPassword) throws FieldException
    {
        return newPassword;
    }

    /**
     * Get the attribute DateTaken
     */
    public Date getDateTaken (Candidate obj, Date original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DateTaken.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Date setDateTaken (Candidate obj, Date newDateTaken) throws FieldException
    {
        return newDateTaken;
    }

    /**
     * Get the attribute Location
     */
    public String getLocation (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Location.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setLocation (Candidate obj, String newLocation) throws FieldException
    {
        return newLocation;
    }

    /**
     * Get the attribute Phone
     */
    public String getPhone (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Phone.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setPhone (Candidate obj, String newPhone) throws FieldException
    {
        return newPhone;
    }

    /**
     * Get the attribute Email
     */
    public String getEmail (Candidate obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Email.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setEmail (Candidate obj, String newEmail) throws FieldException
    {
        return newEmail;
    }

    }

    
    public ORMPipeLine pipes()
    {
        return new CandidatePipeLineFactory<Candidate, Candidate> ((Candidate)this);
    }
      
    /**
     * Use this instead of pipes() to get rid of type casting.
     */  
    public CandidatePipeLineFactory<Candidate, Candidate> pipelineCandidate()
    {
        return (CandidatePipeLineFactory<Candidate, Candidate>) pipes();
    }
    
    public static CandidatePipeLineFactory<Candidate, Candidate> pipesCandidate(Collection<Candidate> items)
    {
        return REFERENCE_Candidate.new CandidatePipeLineFactory<Candidate, Candidate> (items);
    }
    
    public static CandidatePipeLineFactory<Candidate, Candidate> pipesCandidate(Candidate[] _items)
    {
        return pipesCandidate(Arrays.asList (_items));
    }
    
    public static CandidatePipeLineFactory<Candidate, Candidate> pipesCandidate()
    {
        return pipesCandidate((Collection)null);
    }
    
    
    public class CandidatePipeLineFactory<From extends BaseBusinessClass, Me extends Candidate> extends BaseBusinessClass.ORMPipeLine<From, Me>    
    {
        public <Prev> CandidatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
        {
            super (pipeLine, nextPipe);
        }
        
        public CandidatePipeLineFactory (From seed)
        {
            super(seed);
        }

        public CandidatePipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("FirstName"))
            {
                return toFirstName ();
            }                
            if (name.equals ("MiddleName"))
            {
                return toMiddleName ();
            }                
            if (name.equals ("LastName"))
            {
                return toLastName ();
            }                
            if (name.equals ("PreferredName"))
            {
                return toPreferredName ();
            }                
            if (name.equals ("Salutation"))
            {
                return toSalutation ();
            }                
            if (name.equals ("Position"))
            {
                return toPosition ();
            }                
            if (name.equals ("DateOfBirth"))
            {
                return toDateOfBirth ();
            }                
            if (name.equals ("DateRegistered"))
            {
                return toDateRegistered ();
            }                
            if (name.equals ("Gender"))
            {
                return toGender ();
            }                
            if (name.equals ("Password"))
            {
                return toPassword ();
            }                
            if (name.equals ("DateTaken"))
            {
                return toDateTaken ();
            }                
            if (name.equals ("Location"))
            {
                return toLocation ();
            }                
            if (name.equals ("Phone"))
            {
                return toPhone ();
            }                
            if (name.equals ("Email"))
            {
                return toEmail ();
            }                
            
            
            return super.to(name);
        }
        
        
        public PipeLine<From, String> toFirstName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_FirstName));  }
        
        public PipeLine<From, String> toMiddleName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_MiddleName));  }
        
        public PipeLine<From, String> toLastName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_LastName));  }
        
        public PipeLine<From, String> toPreferredName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_PreferredName));  }
        
        public PipeLine<From, String> toSalutation () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Salutation));  }
        
        public PipeLine<From, String> toPosition () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Position));  }
        
        public PipeLine<From, Date> toDateOfBirth () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_DateOfBirth));  }
        
        public PipeLine<From, Date> toDateRegistered () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_DateRegistered));  }
        
        public PipeLine<From, String> toGender () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Gender));  }
        
        public PipeLine<From, String> toPassword () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Password));  }
        
        public PipeLine<From, Date> toDateTaken () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_DateTaken));  }
        
        public PipeLine<From, String> toLocation () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Location));  }
        
        public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone));  }
        
        public PipeLine<From, String> toEmail () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Email));  }
        
    }
    
    public boolean isTransientAttrib(String attribName)
    {
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

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

    public void assertValid ()
    {
    }


}

    
