/*
 * 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 BaseFactor extends BaseBusinessClass
{
    // Reference instance for the object
    public static final Factor REFERENCE_Factor = new Factor ();

    // Reference instance for the object
    public static final Factor DUMMY_Factor = new DummyFactor ();

    // Static constants corresponding to field names
    
    public static final String FIELD_FactorNo = "FactorNo";
    public static final String FIELD_Description = "Description";
    public static final String FIELD_ClassCode = "ClassCode";
    public static final String FIELD_Notes = "Notes";
    public static final String FIELD_LevelNo = "LevelNo";
    public static final String FIELD_LeftAnnot = "LeftAnnot";
    public static final String FIELD_RightAnnot = "RightAnnot";
    public static final String FIELD_DescriptionSchinese = "DescriptionSchinese";
    public static final String FIELD_DescriptionChinese = "DescriptionChinese";
    public static final String FIELD_DescriptionKorean = "DescriptionKorean";
    public static final String FIELD_DescriptionThai = "DescriptionThai";
    public static final String FIELD_ZScoreWeight = "ZScoreWeight";
    public static final String FIELD_ZScoreWeight2 = "ZScoreWeight2";

    // Static constants corresponding to searches
    

    // Static constants corresponding to attribute helpers
    private static final DefaultAttributeHelper<Factor> HELPER_FactorNo = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_Description = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_ClassCode = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_Notes = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_LevelNo = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_LeftAnnot = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_RightAnnot = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_DescriptionSchinese = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_DescriptionChinese = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_DescriptionKorean = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_DescriptionThai = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_ZScoreWeight = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<Factor> HELPER_ZScoreWeight2 = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private Integer _FactorNo;
    private String _Description;
    private String _ClassCode;
    private String _Notes;
    private Integer _LevelNo;
    private String _LeftAnnot;
    private String _RightAnnot;
    private String _DescriptionSchinese;
    private String _DescriptionChinese;
    private String _DescriptionKorean;
    private String _DescriptionThai;
    private Double _ZScoreWeight;
    private Double _ZScoreWeight2;
    

    // Private attributes corresponding to single references
    

    // Private attributes corresponding to multiple references
    

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

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_FactorNo_Validators;
    private static final AttributeValidator[] FIELD_Description_Validators;
    private static final AttributeValidator[] FIELD_ClassCode_Validators;
    private static final AttributeValidator[] FIELD_Notes_Validators;
    private static final AttributeValidator[] FIELD_LevelNo_Validators;
    private static final AttributeValidator[] FIELD_LeftAnnot_Validators;
    private static final AttributeValidator[] FIELD_RightAnnot_Validators;
    private static final AttributeValidator[] FIELD_DescriptionSchinese_Validators;
    private static final AttributeValidator[] FIELD_DescriptionChinese_Validators;
    private static final AttributeValidator[] FIELD_DescriptionKorean_Validators;
    private static final AttributeValidator[] FIELD_DescriptionThai_Validators;
    private static final AttributeValidator[] FIELD_ZScoreWeight_Validators;
    private static final AttributeValidator[] FIELD_ZScoreWeight2_Validators;
    

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

            FIELD_FactorNo_Validators = (AttributeValidator[])setupAttribMetaData_FactorNo(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Description_Validators = (AttributeValidator[])setupAttribMetaData_Description(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ClassCode_Validators = (AttributeValidator[])setupAttribMetaData_ClassCode(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Notes_Validators = (AttributeValidator[])setupAttribMetaData_Notes(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_LevelNo_Validators = (AttributeValidator[])setupAttribMetaData_LevelNo(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_LeftAnnot_Validators = (AttributeValidator[])setupAttribMetaData_LeftAnnot(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_RightAnnot_Validators = (AttributeValidator[])setupAttribMetaData_RightAnnot(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DescriptionSchinese_Validators = (AttributeValidator[])setupAttribMetaData_DescriptionSchinese(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DescriptionChinese_Validators = (AttributeValidator[])setupAttribMetaData_DescriptionChinese(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DescriptionKorean_Validators = (AttributeValidator[])setupAttribMetaData_DescriptionKorean(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_DescriptionThai_Validators = (AttributeValidator[])setupAttribMetaData_DescriptionThai(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ZScoreWeight_Validators = (AttributeValidator[])setupAttribMetaData_ZScoreWeight(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ZScoreWeight2_Validators = (AttributeValidator[])setupAttribMetaData_ZScoreWeight2(validatorMapping).toArray (new AttributeValidator[0]);
            

            REFERENCE_Factor.initialiseReference ();
            DUMMY_Factor.initialiseReference ();
            Factor_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(Factor.class).toArray(new FactorBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

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

        metaInfo.put ("dbcol", "factor_number");
        metaInfo.put ("name", "FactorNo");
        metaInfo.put ("type", "Integer");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.FactorNo:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_FactorNo, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_desc");
        metaInfo.put ("length", "30");
        metaInfo.put ("name", "Description");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.Description:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_Description, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "class_code");
        metaInfo.put ("length", "15");
        metaInfo.put ("name", "ClassCode");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.ClassCode:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_ClassCode, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_notes");
        metaInfo.put ("name", "Notes");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.Notes:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_Notes, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "level_number");
        metaInfo.put ("name", "LevelNo");
        metaInfo.put ("type", "Integer");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.LevelNo:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_LevelNo, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "left_annot");
        metaInfo.put ("length", "60");
        metaInfo.put ("name", "LeftAnnot");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.LeftAnnot:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_LeftAnnot, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "right_annot");
        metaInfo.put ("length", "60");
        metaInfo.put ("name", "RightAnnot");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.RightAnnot:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_RightAnnot, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_desc_schinese");
        metaInfo.put ("length", "120");
        metaInfo.put ("name", "DescriptionSchinese");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.DescriptionSchinese:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_DescriptionSchinese, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_desc_chinese");
        metaInfo.put ("length", "120");
        metaInfo.put ("name", "DescriptionChinese");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.DescriptionChinese:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_DescriptionChinese, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_desc_korean");
        metaInfo.put ("length", "120");
        metaInfo.put ("name", "DescriptionKorean");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.DescriptionKorean:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_DescriptionKorean, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "factor_hdr_desc_thai");
        metaInfo.put ("length", "120");
        metaInfo.put ("name", "DescriptionThai");
        metaInfo.put ("type", "String");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.DescriptionThai:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_DescriptionThai, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "z_score_wght");
        metaInfo.put ("name", "ZScoreWeight");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.ZScoreWeight:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_ZScoreWeight, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "z_score_wght_2");
        metaInfo.put ("name", "ZScoreWeight2");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Factor.ZScoreWeight2:", metaInfo);
        ATTRIBUTES_METADATA_Factor.put (FIELD_ZScoreWeight2, Collections.unmodifiableMap (metaInfo));

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

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


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


    


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

        
        _FactorNo = (Integer)(HELPER_FactorNo.initialise (_FactorNo));
        _Description = (String)(HELPER_Description.initialise (_Description));
        _ClassCode = (String)(HELPER_ClassCode.initialise (_ClassCode));
        _Notes = (String)(HELPER_Notes.initialise (_Notes));
        _LevelNo = (Integer)(HELPER_LevelNo.initialise (_LevelNo));
        _LeftAnnot = (String)(HELPER_LeftAnnot.initialise (_LeftAnnot));
        _RightAnnot = (String)(HELPER_RightAnnot.initialise (_RightAnnot));
        _DescriptionSchinese = (String)(HELPER_DescriptionSchinese.initialise (_DescriptionSchinese));
        _DescriptionChinese = (String)(HELPER_DescriptionChinese.initialise (_DescriptionChinese));
        _DescriptionKorean = (String)(HELPER_DescriptionKorean.initialise (_DescriptionKorean));
        _DescriptionThai = (String)(HELPER_DescriptionThai.initialise (_DescriptionThai));
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.initialise (_ZScoreWeight));
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.initialise (_ZScoreWeight2));
    }


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

        
    }


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

    

    /**
     * Get the attribute FactorNo
     */
    public Integer getFactorNo ()
    {
        assertValid();
        Integer valToReturn = _FactorNo;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getFactorNo ((Factor)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 preFactorNoChange (Integer newFactorNo) 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 postFactorNoChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute FactorNo.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setFactorNo (Integer newFactorNo) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_FactorNo.compare (_FactorNo, newFactorNo);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newFactorNo = bhd.setFactorNo ((Factor)this, newFactorNo);
                oldAndNewIdentical = HELPER_FactorNo.compare (_FactorNo, newFactorNo);
            }

            

            if (FIELD_FactorNo_Validators.length > 0)
            {
                Object newFactorNoObj = HELPER_FactorNo.toObject (newFactorNo);

                if (newFactorNoObj != null)
                {
                    int     loopMax = FIELD_FactorNo_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_FactorNo);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_FactorNo () != FieldWriteability.FALSE, "Field  FactorNo is not writeable");
            preFactorNoChange (newFactorNo);
            markFieldChange (FIELD_FactorNo);
            _FactorNo = newFactorNo;            
            postFieldChange (FIELD_FactorNo);
            postFactorNoChange ();
        }
    }

    /**
     * Get the attribute Description
     */
    public String getDescription ()
    {
        assertValid();
        String valToReturn = _Description;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getDescription ((Factor)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 preDescriptionChange (String newDescription) 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 postDescriptionChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Description.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDescription (String newDescription) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newDescription = bhd.setDescription ((Factor)this, newDescription);
                oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
            }

            

            if (FIELD_Description_Validators.length > 0)
            {
                Object newDescriptionObj = HELPER_Description.toObject (newDescription);

                if (newDescriptionObj != null)
                {
                    int     loopMax = FIELD_Description_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_Description);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Description () != FieldWriteability.FALSE, "Field  Description is not writeable");
            preDescriptionChange (newDescription);
            markFieldChange (FIELD_Description);
            _Description = newDescription;            
            postFieldChange (FIELD_Description);
            postDescriptionChange ();
        }
    }

    /**
     * Get the attribute ClassCode
     */
    public String getClassCode ()
    {
        assertValid();
        String valToReturn = _ClassCode;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getClassCode ((Factor)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 preClassCodeChange (String newClassCode) 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 postClassCodeChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute ClassCode.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setClassCode (String newClassCode) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_ClassCode.compare (_ClassCode, newClassCode);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newClassCode = bhd.setClassCode ((Factor)this, newClassCode);
                oldAndNewIdentical = HELPER_ClassCode.compare (_ClassCode, newClassCode);
            }

            

            if (FIELD_ClassCode_Validators.length > 0)
            {
                Object newClassCodeObj = HELPER_ClassCode.toObject (newClassCode);

                if (newClassCodeObj != null)
                {
                    int     loopMax = FIELD_ClassCode_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_ClassCode);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_ClassCode () != FieldWriteability.FALSE, "Field  ClassCode is not writeable");
            preClassCodeChange (newClassCode);
            markFieldChange (FIELD_ClassCode);
            _ClassCode = newClassCode;            
            postFieldChange (FIELD_ClassCode);
            postClassCodeChange ();
        }
    }

    /**
     * Get the attribute Notes
     */
    public String getNotes ()
    {
        assertValid();
        String valToReturn = _Notes;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getNotes ((Factor)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 preNotesChange (String newNotes) 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 postNotesChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Notes.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setNotes (String newNotes) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_Notes.compare (_Notes, newNotes);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newNotes = bhd.setNotes ((Factor)this, newNotes);
                oldAndNewIdentical = HELPER_Notes.compare (_Notes, newNotes);
            }

            

            if (FIELD_Notes_Validators.length > 0)
            {
                Object newNotesObj = HELPER_Notes.toObject (newNotes);

                if (newNotesObj != null)
                {
                    int     loopMax = FIELD_Notes_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_Notes);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_Notes () != FieldWriteability.FALSE, "Field  Notes is not writeable");
            preNotesChange (newNotes);
            markFieldChange (FIELD_Notes);
            _Notes = newNotes;            
            postFieldChange (FIELD_Notes);
            postNotesChange ();
        }
    }

    /**
     * Get the attribute LevelNo
     */
    public Integer getLevelNo ()
    {
        assertValid();
        Integer valToReturn = _LevelNo;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getLevelNo ((Factor)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 preLevelNoChange (Integer newLevelNo) 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 postLevelNoChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute LevelNo.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setLevelNo (Integer newLevelNo) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_LevelNo.compare (_LevelNo, newLevelNo);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newLevelNo = bhd.setLevelNo ((Factor)this, newLevelNo);
                oldAndNewIdentical = HELPER_LevelNo.compare (_LevelNo, newLevelNo);
            }

            

            if (FIELD_LevelNo_Validators.length > 0)
            {
                Object newLevelNoObj = HELPER_LevelNo.toObject (newLevelNo);

                if (newLevelNoObj != null)
                {
                    int     loopMax = FIELD_LevelNo_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_LevelNo);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_LevelNo () != FieldWriteability.FALSE, "Field  LevelNo is not writeable");
            preLevelNoChange (newLevelNo);
            markFieldChange (FIELD_LevelNo);
            _LevelNo = newLevelNo;            
            postFieldChange (FIELD_LevelNo);
            postLevelNoChange ();
        }
    }

    /**
     * Get the attribute LeftAnnot
     */
    public String getLeftAnnot ()
    {
        assertValid();
        String valToReturn = _LeftAnnot;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getLeftAnnot ((Factor)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 preLeftAnnotChange (String newLeftAnnot) 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 postLeftAnnotChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute LeftAnnot.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setLeftAnnot (String newLeftAnnot) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_LeftAnnot.compare (_LeftAnnot, newLeftAnnot);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newLeftAnnot = bhd.setLeftAnnot ((Factor)this, newLeftAnnot);
                oldAndNewIdentical = HELPER_LeftAnnot.compare (_LeftAnnot, newLeftAnnot);
            }

            

            if (FIELD_LeftAnnot_Validators.length > 0)
            {
                Object newLeftAnnotObj = HELPER_LeftAnnot.toObject (newLeftAnnot);

                if (newLeftAnnotObj != null)
                {
                    int     loopMax = FIELD_LeftAnnot_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_LeftAnnot);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_LeftAnnot () != FieldWriteability.FALSE, "Field  LeftAnnot is not writeable");
            preLeftAnnotChange (newLeftAnnot);
            markFieldChange (FIELD_LeftAnnot);
            _LeftAnnot = newLeftAnnot;            
            postFieldChange (FIELD_LeftAnnot);
            postLeftAnnotChange ();
        }
    }

    /**
     * Get the attribute RightAnnot
     */
    public String getRightAnnot ()
    {
        assertValid();
        String valToReturn = _RightAnnot;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getRightAnnot ((Factor)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 preRightAnnotChange (String newRightAnnot) 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 postRightAnnotChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute RightAnnot.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setRightAnnot (String newRightAnnot) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_RightAnnot.compare (_RightAnnot, newRightAnnot);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newRightAnnot = bhd.setRightAnnot ((Factor)this, newRightAnnot);
                oldAndNewIdentical = HELPER_RightAnnot.compare (_RightAnnot, newRightAnnot);
            }

            

            if (FIELD_RightAnnot_Validators.length > 0)
            {
                Object newRightAnnotObj = HELPER_RightAnnot.toObject (newRightAnnot);

                if (newRightAnnotObj != null)
                {
                    int     loopMax = FIELD_RightAnnot_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_RightAnnot);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_RightAnnot () != FieldWriteability.FALSE, "Field  RightAnnot is not writeable");
            preRightAnnotChange (newRightAnnot);
            markFieldChange (FIELD_RightAnnot);
            _RightAnnot = newRightAnnot;            
            postFieldChange (FIELD_RightAnnot);
            postRightAnnotChange ();
        }
    }

    /**
     * Get the attribute DescriptionSchinese
     */
    public String getDescriptionSchinese ()
    {
        assertValid();
        String valToReturn = _DescriptionSchinese;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getDescriptionSchinese ((Factor)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 preDescriptionSchineseChange (String newDescriptionSchinese) 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 postDescriptionSchineseChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DescriptionSchinese.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDescriptionSchinese (String newDescriptionSchinese) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DescriptionSchinese.compare (_DescriptionSchinese, newDescriptionSchinese);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newDescriptionSchinese = bhd.setDescriptionSchinese ((Factor)this, newDescriptionSchinese);
                oldAndNewIdentical = HELPER_DescriptionSchinese.compare (_DescriptionSchinese, newDescriptionSchinese);
            }

            

            if (FIELD_DescriptionSchinese_Validators.length > 0)
            {
                Object newDescriptionSchineseObj = HELPER_DescriptionSchinese.toObject (newDescriptionSchinese);

                if (newDescriptionSchineseObj != null)
                {
                    int     loopMax = FIELD_DescriptionSchinese_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_DescriptionSchinese);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DescriptionSchinese () != FieldWriteability.FALSE, "Field  DescriptionSchinese is not writeable");
            preDescriptionSchineseChange (newDescriptionSchinese);
            markFieldChange (FIELD_DescriptionSchinese);
            _DescriptionSchinese = newDescriptionSchinese;            
            postFieldChange (FIELD_DescriptionSchinese);
            postDescriptionSchineseChange ();
        }
    }

    /**
     * Get the attribute DescriptionChinese
     */
    public String getDescriptionChinese ()
    {
        assertValid();
        String valToReturn = _DescriptionChinese;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getDescriptionChinese ((Factor)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 preDescriptionChineseChange (String newDescriptionChinese) 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 postDescriptionChineseChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DescriptionChinese.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDescriptionChinese (String newDescriptionChinese) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DescriptionChinese.compare (_DescriptionChinese, newDescriptionChinese);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newDescriptionChinese = bhd.setDescriptionChinese ((Factor)this, newDescriptionChinese);
                oldAndNewIdentical = HELPER_DescriptionChinese.compare (_DescriptionChinese, newDescriptionChinese);
            }

            

            if (FIELD_DescriptionChinese_Validators.length > 0)
            {
                Object newDescriptionChineseObj = HELPER_DescriptionChinese.toObject (newDescriptionChinese);

                if (newDescriptionChineseObj != null)
                {
                    int     loopMax = FIELD_DescriptionChinese_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_DescriptionChinese);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DescriptionChinese () != FieldWriteability.FALSE, "Field  DescriptionChinese is not writeable");
            preDescriptionChineseChange (newDescriptionChinese);
            markFieldChange (FIELD_DescriptionChinese);
            _DescriptionChinese = newDescriptionChinese;            
            postFieldChange (FIELD_DescriptionChinese);
            postDescriptionChineseChange ();
        }
    }

    /**
     * Get the attribute DescriptionKorean
     */
    public String getDescriptionKorean ()
    {
        assertValid();
        String valToReturn = _DescriptionKorean;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getDescriptionKorean ((Factor)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 preDescriptionKoreanChange (String newDescriptionKorean) 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 postDescriptionKoreanChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DescriptionKorean.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDescriptionKorean (String newDescriptionKorean) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DescriptionKorean.compare (_DescriptionKorean, newDescriptionKorean);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newDescriptionKorean = bhd.setDescriptionKorean ((Factor)this, newDescriptionKorean);
                oldAndNewIdentical = HELPER_DescriptionKorean.compare (_DescriptionKorean, newDescriptionKorean);
            }

            

            if (FIELD_DescriptionKorean_Validators.length > 0)
            {
                Object newDescriptionKoreanObj = HELPER_DescriptionKorean.toObject (newDescriptionKorean);

                if (newDescriptionKoreanObj != null)
                {
                    int     loopMax = FIELD_DescriptionKorean_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_DescriptionKorean);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DescriptionKorean () != FieldWriteability.FALSE, "Field  DescriptionKorean is not writeable");
            preDescriptionKoreanChange (newDescriptionKorean);
            markFieldChange (FIELD_DescriptionKorean);
            _DescriptionKorean = newDescriptionKorean;            
            postFieldChange (FIELD_DescriptionKorean);
            postDescriptionKoreanChange ();
        }
    }

    /**
     * Get the attribute DescriptionThai
     */
    public String getDescriptionThai ()
    {
        assertValid();
        String valToReturn = _DescriptionThai;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getDescriptionThai ((Factor)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 preDescriptionThaiChange (String newDescriptionThai) 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 postDescriptionThaiChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute DescriptionThai.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDescriptionThai (String newDescriptionThai) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_DescriptionThai.compare (_DescriptionThai, newDescriptionThai);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newDescriptionThai = bhd.setDescriptionThai ((Factor)this, newDescriptionThai);
                oldAndNewIdentical = HELPER_DescriptionThai.compare (_DescriptionThai, newDescriptionThai);
            }

            

            if (FIELD_DescriptionThai_Validators.length > 0)
            {
                Object newDescriptionThaiObj = HELPER_DescriptionThai.toObject (newDescriptionThai);

                if (newDescriptionThaiObj != null)
                {
                    int     loopMax = FIELD_DescriptionThai_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_DescriptionThai);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_DescriptionThai () != FieldWriteability.FALSE, "Field  DescriptionThai is not writeable");
            preDescriptionThaiChange (newDescriptionThai);
            markFieldChange (FIELD_DescriptionThai);
            _DescriptionThai = newDescriptionThai;            
            postFieldChange (FIELD_DescriptionThai);
            postDescriptionThaiChange ();
        }
    }

    /**
     * Get the attribute ZScoreWeight
     */
    public Double getZScoreWeight ()
    {
        assertValid();
        Double valToReturn = _ZScoreWeight;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getZScoreWeight ((Factor)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 preZScoreWeightChange (Double newZScoreWeight) 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 postZScoreWeightChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute ZScoreWeight.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setZScoreWeight (Double newZScoreWeight) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_ZScoreWeight.compare (_ZScoreWeight, newZScoreWeight);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newZScoreWeight = bhd.setZScoreWeight ((Factor)this, newZScoreWeight);
                oldAndNewIdentical = HELPER_ZScoreWeight.compare (_ZScoreWeight, newZScoreWeight);
            }

            

            if (FIELD_ZScoreWeight_Validators.length > 0)
            {
                Object newZScoreWeightObj = HELPER_ZScoreWeight.toObject (newZScoreWeight);

                if (newZScoreWeightObj != null)
                {
                    int     loopMax = FIELD_ZScoreWeight_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_ZScoreWeight);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_ZScoreWeight () != FieldWriteability.FALSE, "Field  ZScoreWeight is not writeable");
            preZScoreWeightChange (newZScoreWeight);
            markFieldChange (FIELD_ZScoreWeight);
            _ZScoreWeight = newZScoreWeight;            
            postFieldChange (FIELD_ZScoreWeight);
            postZScoreWeightChange ();
        }
    }

    /**
     * Get the attribute ZScoreWeight2
     */
    public Double getZScoreWeight2 ()
    {
        assertValid();
        Double valToReturn = _ZScoreWeight2;

            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                valToReturn = bhd.getZScoreWeight2 ((Factor)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 preZScoreWeight2Change (Double newZScoreWeight2) 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 postZScoreWeight2Change () throws FieldException
    {
    }

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

    /**
     * Set the attribute ZScoreWeight2.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setZScoreWeight2 (Double newZScoreWeight2) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_ZScoreWeight2.compare (_ZScoreWeight2, newZScoreWeight2);
        
        try
        {
            for (FactorBehaviourDecorator bhd : Factor_BehaviourDecorators)
            {
                newZScoreWeight2 = bhd.setZScoreWeight2 ((Factor)this, newZScoreWeight2);
                oldAndNewIdentical = HELPER_ZScoreWeight2.compare (_ZScoreWeight2, newZScoreWeight2);
            }

            

            if (FIELD_ZScoreWeight2_Validators.length > 0)
            {
                Object newZScoreWeight2Obj = HELPER_ZScoreWeight2.toObject (newZScoreWeight2);

                if (newZScoreWeight2Obj != null)
                {
                    int     loopMax = FIELD_ZScoreWeight2_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_Factor.get (FIELD_ZScoreWeight2);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_ZScoreWeight2 () != FieldWriteability.FALSE, "Field  ZScoreWeight2 is not writeable");
            preZScoreWeight2Change (newZScoreWeight2);
            markFieldChange (FIELD_ZScoreWeight2);
            _ZScoreWeight2 = newZScoreWeight2;            
            postFieldChange (FIELD_ZScoreWeight2);
            postZScoreWeight2Change ();
        }
    }



    /**
     * 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 Factor newInstance ()
    {
        return new Factor ();
    }


    public Factor referenceInstance ()
    {
        return REFERENCE_Factor;
    }


    public Factor getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getFactorByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_Factor;
    }


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





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

        factor_hdrPSet.setAttrib (FIELD_ObjectID, myID);
        factor_hdrPSet.setAttrib (FIELD_FactorNo, HELPER_FactorNo.toObject (_FactorNo)); //
        factor_hdrPSet.setAttrib (FIELD_Description, HELPER_Description.toObject (_Description)); //
        factor_hdrPSet.setAttrib (FIELD_ClassCode, HELPER_ClassCode.toObject (_ClassCode)); //
        factor_hdrPSet.setAttrib (FIELD_Notes, HELPER_Notes.toObject (_Notes)); //
        factor_hdrPSet.setAttrib (FIELD_LevelNo, HELPER_LevelNo.toObject (_LevelNo)); //
        factor_hdrPSet.setAttrib (FIELD_LeftAnnot, HELPER_LeftAnnot.toObject (_LeftAnnot)); //
        factor_hdrPSet.setAttrib (FIELD_RightAnnot, HELPER_RightAnnot.toObject (_RightAnnot)); //
        factor_hdrPSet.setAttrib (FIELD_DescriptionSchinese, HELPER_DescriptionSchinese.toObject (_DescriptionSchinese)); //
        factor_hdrPSet.setAttrib (FIELD_DescriptionChinese, HELPER_DescriptionChinese.toObject (_DescriptionChinese)); //
        factor_hdrPSet.setAttrib (FIELD_DescriptionKorean, HELPER_DescriptionKorean.toObject (_DescriptionKorean)); //
        factor_hdrPSet.setAttrib (FIELD_DescriptionThai, HELPER_DescriptionThai.toObject (_DescriptionThai)); //
        factor_hdrPSet.setAttrib (FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject (_ZScoreWeight)); //
        factor_hdrPSet.setAttrib (FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject (_ZScoreWeight2)); //
        
    }


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

        
        PersistentSet   factor_hdrPSet = allSets.getPersistentSet (objectID, "factor_hdr");

        _FactorNo = (Integer)(HELPER_FactorNo.fromObject (_FactorNo, factor_hdrPSet.getAttrib (FIELD_FactorNo))); //
        _Description = (String)(HELPER_Description.fromObject (_Description, factor_hdrPSet.getAttrib (FIELD_Description))); //
        _ClassCode = (String)(HELPER_ClassCode.fromObject (_ClassCode, factor_hdrPSet.getAttrib (FIELD_ClassCode))); //
        _Notes = (String)(HELPER_Notes.fromObject (_Notes, factor_hdrPSet.getAttrib (FIELD_Notes))); //
        _LevelNo = (Integer)(HELPER_LevelNo.fromObject (_LevelNo, factor_hdrPSet.getAttrib (FIELD_LevelNo))); //
        _LeftAnnot = (String)(HELPER_LeftAnnot.fromObject (_LeftAnnot, factor_hdrPSet.getAttrib (FIELD_LeftAnnot))); //
        _RightAnnot = (String)(HELPER_RightAnnot.fromObject (_RightAnnot, factor_hdrPSet.getAttrib (FIELD_RightAnnot))); //
        _DescriptionSchinese = (String)(HELPER_DescriptionSchinese.fromObject (_DescriptionSchinese, factor_hdrPSet.getAttrib (FIELD_DescriptionSchinese))); //
        _DescriptionChinese = (String)(HELPER_DescriptionChinese.fromObject (_DescriptionChinese, factor_hdrPSet.getAttrib (FIELD_DescriptionChinese))); //
        _DescriptionKorean = (String)(HELPER_DescriptionKorean.fromObject (_DescriptionKorean, factor_hdrPSet.getAttrib (FIELD_DescriptionKorean))); //
        _DescriptionThai = (String)(HELPER_DescriptionThai.fromObject (_DescriptionThai, factor_hdrPSet.getAttrib (FIELD_DescriptionThai))); //
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.fromObject (_ZScoreWeight, factor_hdrPSet.getAttrib (FIELD_ZScoreWeight))); //
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.fromObject (_ZScoreWeight2, factor_hdrPSet.getAttrib (FIELD_ZScoreWeight2))); //
        
    }





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

        if (other instanceof Factor)
        {
            Factor otherFactor = (Factor)other;
            
            try
            {
                setFactorNo (otherFactor.getFactorNo ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDescription (otherFactor.getDescription ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setClassCode (otherFactor.getClassCode ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setNotes (otherFactor.getNotes ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLevelNo (otherFactor.getLevelNo ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLeftAnnot (otherFactor.getLeftAnnot ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setRightAnnot (otherFactor.getRightAnnot ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDescriptionSchinese (otherFactor.getDescriptionSchinese ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDescriptionChinese (otherFactor.getDescriptionChinese ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDescriptionKorean (otherFactor.getDescriptionKorean ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setDescriptionThai (otherFactor.getDescriptionThai ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setZScoreWeight (otherFactor.getZScoreWeight ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setZScoreWeight2 (otherFactor.getZScoreWeight2 ());
            }
            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 BaseFactor)
        {
            BaseFactor sourceFactor = (BaseFactor)(source);

            _FactorNo = sourceFactor._FactorNo;
            _Description = sourceFactor._Description;
            _ClassCode = sourceFactor._ClassCode;
            _Notes = sourceFactor._Notes;
            _LevelNo = sourceFactor._LevelNo;
            _LeftAnnot = sourceFactor._LeftAnnot;
            _RightAnnot = sourceFactor._RightAnnot;
            _DescriptionSchinese = sourceFactor._DescriptionSchinese;
            _DescriptionChinese = sourceFactor._DescriptionChinese;
            _DescriptionKorean = sourceFactor._DescriptionKorean;
            _DescriptionThai = sourceFactor._DescriptionThai;
            _ZScoreWeight = sourceFactor._ZScoreWeight;
            _ZScoreWeight2 = sourceFactor._ZScoreWeight2;
            
        }
    }


    /**
     * 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 BaseFactor)
        {
            BaseFactor sourceFactor = (BaseFactor)(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 BaseFactor)
        {
            BaseFactor sourceFactor = (BaseFactor)(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);

        _FactorNo = (Integer)(HELPER_FactorNo.readExternal (_FactorNo, vals.get(FIELD_FactorNo))); //
        _Description = (String)(HELPER_Description.readExternal (_Description, vals.get(FIELD_Description))); //
        _ClassCode = (String)(HELPER_ClassCode.readExternal (_ClassCode, vals.get(FIELD_ClassCode))); //
        _Notes = (String)(HELPER_Notes.readExternal (_Notes, vals.get(FIELD_Notes))); //
        _LevelNo = (Integer)(HELPER_LevelNo.readExternal (_LevelNo, vals.get(FIELD_LevelNo))); //
        _LeftAnnot = (String)(HELPER_LeftAnnot.readExternal (_LeftAnnot, vals.get(FIELD_LeftAnnot))); //
        _RightAnnot = (String)(HELPER_RightAnnot.readExternal (_RightAnnot, vals.get(FIELD_RightAnnot))); //
        _DescriptionSchinese = (String)(HELPER_DescriptionSchinese.readExternal (_DescriptionSchinese, vals.get(FIELD_DescriptionSchinese))); //
        _DescriptionChinese = (String)(HELPER_DescriptionChinese.readExternal (_DescriptionChinese, vals.get(FIELD_DescriptionChinese))); //
        _DescriptionKorean = (String)(HELPER_DescriptionKorean.readExternal (_DescriptionKorean, vals.get(FIELD_DescriptionKorean))); //
        _DescriptionThai = (String)(HELPER_DescriptionThai.readExternal (_DescriptionThai, vals.get(FIELD_DescriptionThai))); //
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.readExternal (_ZScoreWeight, vals.get(FIELD_ZScoreWeight))); //
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.readExternal (_ZScoreWeight2, vals.get(FIELD_ZScoreWeight2))); //
        
    }


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

        vals.put (FIELD_FactorNo, HELPER_FactorNo.writeExternal (_FactorNo));
        vals.put (FIELD_Description, HELPER_Description.writeExternal (_Description));
        vals.put (FIELD_ClassCode, HELPER_ClassCode.writeExternal (_ClassCode));
        vals.put (FIELD_Notes, HELPER_Notes.writeExternal (_Notes));
        vals.put (FIELD_LevelNo, HELPER_LevelNo.writeExternal (_LevelNo));
        vals.put (FIELD_LeftAnnot, HELPER_LeftAnnot.writeExternal (_LeftAnnot));
        vals.put (FIELD_RightAnnot, HELPER_RightAnnot.writeExternal (_RightAnnot));
        vals.put (FIELD_DescriptionSchinese, HELPER_DescriptionSchinese.writeExternal (_DescriptionSchinese));
        vals.put (FIELD_DescriptionChinese, HELPER_DescriptionChinese.writeExternal (_DescriptionChinese));
        vals.put (FIELD_DescriptionKorean, HELPER_DescriptionKorean.writeExternal (_DescriptionKorean));
        vals.put (FIELD_DescriptionThai, HELPER_DescriptionThai.writeExternal (_DescriptionThai));
        vals.put (FIELD_ZScoreWeight, HELPER_ZScoreWeight.writeExternal (_ZScoreWeight));
        vals.put (FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.writeExternal (_ZScoreWeight2));
        
    }


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

        if (other instanceof BaseFactor)
        {
            BaseFactor otherFactor = (BaseFactor)(other);

            
            if (!HELPER_FactorNo.compare(this._FactorNo, otherFactor._FactorNo))
            {
                listener.notifyFieldChange(this, other, FIELD_FactorNo, HELPER_FactorNo.toObject(this._FactorNo), HELPER_FactorNo.toObject(otherFactor._FactorNo));
            }
            if (!HELPER_Description.compare(this._Description, otherFactor._Description))
            {
                listener.notifyFieldChange(this, other, FIELD_Description, HELPER_Description.toObject(this._Description), HELPER_Description.toObject(otherFactor._Description));
            }
            if (!HELPER_ClassCode.compare(this._ClassCode, otherFactor._ClassCode))
            {
                listener.notifyFieldChange(this, other, FIELD_ClassCode, HELPER_ClassCode.toObject(this._ClassCode), HELPER_ClassCode.toObject(otherFactor._ClassCode));
            }
            if (!HELPER_Notes.compare(this._Notes, otherFactor._Notes))
            {
                listener.notifyFieldChange(this, other, FIELD_Notes, HELPER_Notes.toObject(this._Notes), HELPER_Notes.toObject(otherFactor._Notes));
            }
            if (!HELPER_LevelNo.compare(this._LevelNo, otherFactor._LevelNo))
            {
                listener.notifyFieldChange(this, other, FIELD_LevelNo, HELPER_LevelNo.toObject(this._LevelNo), HELPER_LevelNo.toObject(otherFactor._LevelNo));
            }
            if (!HELPER_LeftAnnot.compare(this._LeftAnnot, otherFactor._LeftAnnot))
            {
                listener.notifyFieldChange(this, other, FIELD_LeftAnnot, HELPER_LeftAnnot.toObject(this._LeftAnnot), HELPER_LeftAnnot.toObject(otherFactor._LeftAnnot));
            }
            if (!HELPER_RightAnnot.compare(this._RightAnnot, otherFactor._RightAnnot))
            {
                listener.notifyFieldChange(this, other, FIELD_RightAnnot, HELPER_RightAnnot.toObject(this._RightAnnot), HELPER_RightAnnot.toObject(otherFactor._RightAnnot));
            }
            if (!HELPER_DescriptionSchinese.compare(this._DescriptionSchinese, otherFactor._DescriptionSchinese))
            {
                listener.notifyFieldChange(this, other, FIELD_DescriptionSchinese, HELPER_DescriptionSchinese.toObject(this._DescriptionSchinese), HELPER_DescriptionSchinese.toObject(otherFactor._DescriptionSchinese));
            }
            if (!HELPER_DescriptionChinese.compare(this._DescriptionChinese, otherFactor._DescriptionChinese))
            {
                listener.notifyFieldChange(this, other, FIELD_DescriptionChinese, HELPER_DescriptionChinese.toObject(this._DescriptionChinese), HELPER_DescriptionChinese.toObject(otherFactor._DescriptionChinese));
            }
            if (!HELPER_DescriptionKorean.compare(this._DescriptionKorean, otherFactor._DescriptionKorean))
            {
                listener.notifyFieldChange(this, other, FIELD_DescriptionKorean, HELPER_DescriptionKorean.toObject(this._DescriptionKorean), HELPER_DescriptionKorean.toObject(otherFactor._DescriptionKorean));
            }
            if (!HELPER_DescriptionThai.compare(this._DescriptionThai, otherFactor._DescriptionThai))
            {
                listener.notifyFieldChange(this, other, FIELD_DescriptionThai, HELPER_DescriptionThai.toObject(this._DescriptionThai), HELPER_DescriptionThai.toObject(otherFactor._DescriptionThai));
            }
            if (!HELPER_ZScoreWeight.compare(this._ZScoreWeight, otherFactor._ZScoreWeight))
            {
                listener.notifyFieldChange(this, other, FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject(this._ZScoreWeight), HELPER_ZScoreWeight.toObject(otherFactor._ZScoreWeight));
            }
            if (!HELPER_ZScoreWeight2.compare(this._ZScoreWeight2, otherFactor._ZScoreWeight2))
            {
                listener.notifyFieldChange(this, other, FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject(this._ZScoreWeight2), HELPER_ZScoreWeight2.toObject(otherFactor._ZScoreWeight2));
            }

            // 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_FactorNo, HELPER_FactorNo.toObject(getFactorNo()));
        visitor.visitField(this, FIELD_Description, HELPER_Description.toObject(getDescription()));
        visitor.visitField(this, FIELD_ClassCode, HELPER_ClassCode.toObject(getClassCode()));
        visitor.visitField(this, FIELD_Notes, HELPER_Notes.toObject(getNotes()));
        visitor.visitField(this, FIELD_LevelNo, HELPER_LevelNo.toObject(getLevelNo()));
        visitor.visitField(this, FIELD_LeftAnnot, HELPER_LeftAnnot.toObject(getLeftAnnot()));
        visitor.visitField(this, FIELD_RightAnnot, HELPER_RightAnnot.toObject(getRightAnnot()));
        visitor.visitField(this, FIELD_DescriptionSchinese, HELPER_DescriptionSchinese.toObject(getDescriptionSchinese()));
        visitor.visitField(this, FIELD_DescriptionChinese, HELPER_DescriptionChinese.toObject(getDescriptionChinese()));
        visitor.visitField(this, FIELD_DescriptionKorean, HELPER_DescriptionKorean.toObject(getDescriptionKorean()));
        visitor.visitField(this, FIELD_DescriptionThai, HELPER_DescriptionThai.toObject(getDescriptionThai()));
        visitor.visitField(this, FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject(getZScoreWeight()));
        visitor.visitField(this, FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject(getZScoreWeight2()));
        
    }


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

        
    }


    public static Factor createFactor (ObjectTransaction transaction) throws StorageException
    {
        Factor     result = new Factor ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static Factor getFactorByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (Factor)(transaction.getObjectByID (REFERENCE_Factor, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FactorNo))
        {
            return filter.matches (getFactorNo ());
        }
        else if (attribName.equals (FIELD_Description))
        {
            return filter.matches (getDescription ());
        }
        else if (attribName.equals (FIELD_ClassCode))
        {
            return filter.matches (getClassCode ());
        }
        else if (attribName.equals (FIELD_Notes))
        {
            return filter.matches (getNotes ());
        }
        else if (attribName.equals (FIELD_LevelNo))
        {
            return filter.matches (getLevelNo ());
        }
        else if (attribName.equals (FIELD_LeftAnnot))
        {
            return filter.matches (getLeftAnnot ());
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return filter.matches (getRightAnnot ());
        }
        else if (attribName.equals (FIELD_DescriptionSchinese))
        {
            return filter.matches (getDescriptionSchinese ());
        }
        else if (attribName.equals (FIELD_DescriptionChinese))
        {
            return filter.matches (getDescriptionChinese ());
        }
        else if (attribName.equals (FIELD_DescriptionKorean))
        {
            return filter.matches (getDescriptionKorean ());
        }
        else if (attribName.equals (FIELD_DescriptionThai))
        {
            return filter.matches (getDescriptionThai ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight))
        {
            return filter.matches (getZScoreWeight ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight2))
        {
            return filter.matches (getZScoreWeight2 ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }




    public Object getAttribute (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FactorNo))
        {
            return HELPER_FactorNo.toObject (getFactorNo ());
        }
        else if (attribName.equals (FIELD_Description))
        {
            return HELPER_Description.toObject (getDescription ());
        }
        else if (attribName.equals (FIELD_ClassCode))
        {
            return HELPER_ClassCode.toObject (getClassCode ());
        }
        else if (attribName.equals (FIELD_Notes))
        {
            return HELPER_Notes.toObject (getNotes ());
        }
        else if (attribName.equals (FIELD_LevelNo))
        {
            return HELPER_LevelNo.toObject (getLevelNo ());
        }
        else if (attribName.equals (FIELD_LeftAnnot))
        {
            return HELPER_LeftAnnot.toObject (getLeftAnnot ());
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return HELPER_RightAnnot.toObject (getRightAnnot ());
        }
        else if (attribName.equals (FIELD_DescriptionSchinese))
        {
            return HELPER_DescriptionSchinese.toObject (getDescriptionSchinese ());
        }
        else if (attribName.equals (FIELD_DescriptionChinese))
        {
            return HELPER_DescriptionChinese.toObject (getDescriptionChinese ());
        }
        else if (attribName.equals (FIELD_DescriptionKorean))
        {
            return HELPER_DescriptionKorean.toObject (getDescriptionKorean ());
        }
        else if (attribName.equals (FIELD_DescriptionThai))
        {
            return HELPER_DescriptionThai.toObject (getDescriptionThai ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight))
        {
            return HELPER_ZScoreWeight.toObject (getZScoreWeight ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight2))
        {
            return HELPER_ZScoreWeight2.toObject (getZScoreWeight2 ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FactorNo))
        {
            return HELPER_FactorNo;
        }
        else if (attribName.equals (FIELD_Description))
        {
            return HELPER_Description;
        }
        else if (attribName.equals (FIELD_ClassCode))
        {
            return HELPER_ClassCode;
        }
        else if (attribName.equals (FIELD_Notes))
        {
            return HELPER_Notes;
        }
        else if (attribName.equals (FIELD_LevelNo))
        {
            return HELPER_LevelNo;
        }
        else if (attribName.equals (FIELD_LeftAnnot))
        {
            return HELPER_LeftAnnot;
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return HELPER_RightAnnot;
        }
        else if (attribName.equals (FIELD_DescriptionSchinese))
        {
            return HELPER_DescriptionSchinese;
        }
        else if (attribName.equals (FIELD_DescriptionChinese))
        {
            return HELPER_DescriptionChinese;
        }
        else if (attribName.equals (FIELD_DescriptionKorean))
        {
            return HELPER_DescriptionKorean;
        }
        else if (attribName.equals (FIELD_DescriptionThai))
        {
            return HELPER_DescriptionThai;
        }
        else if (attribName.equals (FIELD_ZScoreWeight))
        {
            return HELPER_ZScoreWeight;
        }
        else if (attribName.equals (FIELD_ZScoreWeight2))
        {
            return HELPER_ZScoreWeight2;
        }
        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_FactorNo))
        {
            setFactorNo ((Integer)(HELPER_FactorNo.fromObject (_FactorNo, attribValue)));            
        }
        else if (attribName.equals (FIELD_Description))
        {
            setDescription ((String)(HELPER_Description.fromObject (_Description, attribValue)));            
        }
        else if (attribName.equals (FIELD_ClassCode))
        {
            setClassCode ((String)(HELPER_ClassCode.fromObject (_ClassCode, attribValue)));            
        }
        else if (attribName.equals (FIELD_Notes))
        {
            setNotes ((String)(HELPER_Notes.fromObject (_Notes, attribValue)));            
        }
        else if (attribName.equals (FIELD_LevelNo))
        {
            setLevelNo ((Integer)(HELPER_LevelNo.fromObject (_LevelNo, attribValue)));            
        }
        else if (attribName.equals (FIELD_LeftAnnot))
        {
            setLeftAnnot ((String)(HELPER_LeftAnnot.fromObject (_LeftAnnot, attribValue)));            
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            setRightAnnot ((String)(HELPER_RightAnnot.fromObject (_RightAnnot, attribValue)));            
        }
        else if (attribName.equals (FIELD_DescriptionSchinese))
        {
            setDescriptionSchinese ((String)(HELPER_DescriptionSchinese.fromObject (_DescriptionSchinese, attribValue)));            
        }
        else if (attribName.equals (FIELD_DescriptionChinese))
        {
            setDescriptionChinese ((String)(HELPER_DescriptionChinese.fromObject (_DescriptionChinese, attribValue)));            
        }
        else if (attribName.equals (FIELD_DescriptionKorean))
        {
            setDescriptionKorean ((String)(HELPER_DescriptionKorean.fromObject (_DescriptionKorean, attribValue)));            
        }
        else if (attribName.equals (FIELD_DescriptionThai))
        {
            setDescriptionThai ((String)(HELPER_DescriptionThai.fromObject (_DescriptionThai, attribValue)));            
        }
        else if (attribName.equals (FIELD_ZScoreWeight))
        {
            setZScoreWeight ((Double)(HELPER_ZScoreWeight.fromObject (_ZScoreWeight, attribValue)));            
        }
        else if (attribName.equals (FIELD_ZScoreWeight2))
        {
            setZScoreWeight2 ((Double)(HELPER_ZScoreWeight2.fromObject (_ZScoreWeight2, 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_FactorNo))
        {
            return getWriteability_FactorNo ();
        }
        else if (fieldName.equals (FIELD_Description))
        {
            return getWriteability_Description ();
        }
        else if (fieldName.equals (FIELD_ClassCode))
        {
            return getWriteability_ClassCode ();
        }
        else if (fieldName.equals (FIELD_Notes))
        {
            return getWriteability_Notes ();
        }
        else if (fieldName.equals (FIELD_LevelNo))
        {
            return getWriteability_LevelNo ();
        }
        else if (fieldName.equals (FIELD_LeftAnnot))
        {
            return getWriteability_LeftAnnot ();
        }
        else if (fieldName.equals (FIELD_RightAnnot))
        {
            return getWriteability_RightAnnot ();
        }
        else if (fieldName.equals (FIELD_DescriptionSchinese))
        {
            return getWriteability_DescriptionSchinese ();
        }
        else if (fieldName.equals (FIELD_DescriptionChinese))
        {
            return getWriteability_DescriptionChinese ();
        }
        else if (fieldName.equals (FIELD_DescriptionKorean))
        {
            return getWriteability_DescriptionKorean ();
        }
        else if (fieldName.equals (FIELD_DescriptionThai))
        {
            return getWriteability_DescriptionThai ();
        }
        else if (fieldName.equals (FIELD_ZScoreWeight))
        {
            return getWriteability_ZScoreWeight ();
        }
        else if (fieldName.equals (FIELD_ZScoreWeight2))
        {
            return getWriteability_ZScoreWeight2 ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        
            if (getWriteability_FactorNo () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_FactorNo);
            }
        
            if (getWriteability_Description () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Description);
            }
        
            if (getWriteability_ClassCode () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_ClassCode);
            }
        
            if (getWriteability_Notes () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Notes);
            }
        
            if (getWriteability_LevelNo () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_LevelNo);
            }
        
            if (getWriteability_LeftAnnot () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_LeftAnnot);
            }
        
            if (getWriteability_RightAnnot () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_RightAnnot);
            }
        
            if (getWriteability_DescriptionSchinese () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DescriptionSchinese);
            }
        
            if (getWriteability_DescriptionChinese () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DescriptionChinese);
            }
        
            if (getWriteability_DescriptionKorean () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DescriptionKorean);
            }
        
            if (getWriteability_DescriptionThai () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_DescriptionThai);
            }
        
            if (getWriteability_ZScoreWeight () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_ZScoreWeight);
            }
        
            if (getWriteability_ZScoreWeight2 () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_ZScoreWeight2);
            }
        

        super.putUnwriteable (fields);
    }

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

        
        result.add(HELPER_FactorNo.getAttribObject (getClass (), _FactorNo, false, FIELD_FactorNo));
        result.add(HELPER_Description.getAttribObject (getClass (), _Description, false, FIELD_Description));
        result.add(HELPER_ClassCode.getAttribObject (getClass (), _ClassCode, false, FIELD_ClassCode));
        result.add(HELPER_Notes.getAttribObject (getClass (), _Notes, false, FIELD_Notes));
        result.add(HELPER_LevelNo.getAttribObject (getClass (), _LevelNo, false, FIELD_LevelNo));
        result.add(HELPER_LeftAnnot.getAttribObject (getClass (), _LeftAnnot, false, FIELD_LeftAnnot));
        result.add(HELPER_RightAnnot.getAttribObject (getClass (), _RightAnnot, false, FIELD_RightAnnot));
        result.add(HELPER_DescriptionSchinese.getAttribObject (getClass (), _DescriptionSchinese, false, FIELD_DescriptionSchinese));
        result.add(HELPER_DescriptionChinese.getAttribObject (getClass (), _DescriptionChinese, false, FIELD_DescriptionChinese));
        result.add(HELPER_DescriptionKorean.getAttribObject (getClass (), _DescriptionKorean, false, FIELD_DescriptionKorean));
        result.add(HELPER_DescriptionThai.getAttribObject (getClass (), _DescriptionThai, false, FIELD_DescriptionThai));
        result.add(HELPER_ZScoreWeight.getAttribObject (getClass (), _ZScoreWeight, false, FIELD_ZScoreWeight));
        result.add(HELPER_ZScoreWeight2.getAttribObject (getClass (), _ZScoreWeight2, false, FIELD_ZScoreWeight2));

        return result;
    }


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


    public Object getAttributeMetadata (String attribute, String metadata)
    {
        if (ATTRIBUTES_METADATA_Factor.containsKey (attribute))
        {
            return ((Map)ATTRIBUTES_METADATA_Factor.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 FactorBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<Factor>
    {

    /**
     * Get the attribute FactorNo
     */
    public Integer getFactorNo (Factor obj, Integer original)
    {
        return original;
    }

    /**
     * Change the value set for attribute FactorNo.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Integer setFactorNo (Factor obj, Integer newFactorNo) throws FieldException
    {
        return newFactorNo;
    }

    /**
     * Get the attribute Description
     */
    public String getDescription (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Description.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setDescription (Factor obj, String newDescription) throws FieldException
    {
        return newDescription;
    }

    /**
     * Get the attribute ClassCode
     */
    public String getClassCode (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute ClassCode.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setClassCode (Factor obj, String newClassCode) throws FieldException
    {
        return newClassCode;
    }

    /**
     * Get the attribute Notes
     */
    public String getNotes (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Notes.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setNotes (Factor obj, String newNotes) throws FieldException
    {
        return newNotes;
    }

    /**
     * Get the attribute LevelNo
     */
    public Integer getLevelNo (Factor obj, Integer original)
    {
        return original;
    }

    /**
     * Change the value set for attribute LevelNo.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Integer setLevelNo (Factor obj, Integer newLevelNo) throws FieldException
    {
        return newLevelNo;
    }

    /**
     * Get the attribute LeftAnnot
     */
    public String getLeftAnnot (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute LeftAnnot.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setLeftAnnot (Factor obj, String newLeftAnnot) throws FieldException
    {
        return newLeftAnnot;
    }

    /**
     * Get the attribute RightAnnot
     */
    public String getRightAnnot (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute RightAnnot.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setRightAnnot (Factor obj, String newRightAnnot) throws FieldException
    {
        return newRightAnnot;
    }

    /**
     * Get the attribute DescriptionSchinese
     */
    public String getDescriptionSchinese (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DescriptionSchinese.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setDescriptionSchinese (Factor obj, String newDescriptionSchinese) throws FieldException
    {
        return newDescriptionSchinese;
    }

    /**
     * Get the attribute DescriptionChinese
     */
    public String getDescriptionChinese (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DescriptionChinese.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setDescriptionChinese (Factor obj, String newDescriptionChinese) throws FieldException
    {
        return newDescriptionChinese;
    }

    /**
     * Get the attribute DescriptionKorean
     */
    public String getDescriptionKorean (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DescriptionKorean.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setDescriptionKorean (Factor obj, String newDescriptionKorean) throws FieldException
    {
        return newDescriptionKorean;
    }

    /**
     * Get the attribute DescriptionThai
     */
    public String getDescriptionThai (Factor obj, String original)
    {
        return original;
    }

    /**
     * Change the value set for attribute DescriptionThai.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public String setDescriptionThai (Factor obj, String newDescriptionThai) throws FieldException
    {
        return newDescriptionThai;
    }

    /**
     * Get the attribute ZScoreWeight
     */
    public Double getZScoreWeight (Factor obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute ZScoreWeight.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setZScoreWeight (Factor obj, Double newZScoreWeight) throws FieldException
    {
        return newZScoreWeight;
    }

    /**
     * Get the attribute ZScoreWeight2
     */
    public Double getZScoreWeight2 (Factor obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute ZScoreWeight2.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setZScoreWeight2 (Factor obj, Double newZScoreWeight2) throws FieldException
    {
        return newZScoreWeight2;
    }

    }

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

        public FactorPipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("FactorNo"))
            {
                return toFactorNo ();
            }                
            if (name.equals ("Description"))
            {
                return toDescription ();
            }                
            if (name.equals ("ClassCode"))
            {
                return toClassCode ();
            }                
            if (name.equals ("Notes"))
            {
                return toNotes ();
            }                
            if (name.equals ("LevelNo"))
            {
                return toLevelNo ();
            }                
            if (name.equals ("LeftAnnot"))
            {
                return toLeftAnnot ();
            }                
            if (name.equals ("RightAnnot"))
            {
                return toRightAnnot ();
            }                
            if (name.equals ("DescriptionSchinese"))
            {
                return toDescriptionSchinese ();
            }                
            if (name.equals ("DescriptionChinese"))
            {
                return toDescriptionChinese ();
            }                
            if (name.equals ("DescriptionKorean"))
            {
                return toDescriptionKorean ();
            }                
            if (name.equals ("DescriptionThai"))
            {
                return toDescriptionThai ();
            }                
            if (name.equals ("ZScoreWeight"))
            {
                return toZScoreWeight ();
            }                
            if (name.equals ("ZScoreWeight2"))
            {
                return toZScoreWeight2 ();
            }                
            
            
            return super.to(name);
        }
        
        
        public PipeLine<From, Integer> toFactorNo () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_FactorNo));  }
        
        public PipeLine<From, String> toDescription () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Description));  }
        
        public PipeLine<From, String> toClassCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ClassCode));  }
        
        public PipeLine<From, String> toNotes () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Notes));  }
        
        public PipeLine<From, Integer> toLevelNo () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_LevelNo));  }
        
        public PipeLine<From, String> toLeftAnnot () { return pipe(new ORMAttributePipe<Me, String>(FIELD_LeftAnnot));  }
        
        public PipeLine<From, String> toRightAnnot () { return pipe(new ORMAttributePipe<Me, String>(FIELD_RightAnnot));  }
        
        public PipeLine<From, String> toDescriptionSchinese () { return pipe(new ORMAttributePipe<Me, String>(FIELD_DescriptionSchinese));  }
        
        public PipeLine<From, String> toDescriptionChinese () { return pipe(new ORMAttributePipe<Me, String>(FIELD_DescriptionChinese));  }
        
        public PipeLine<From, String> toDescriptionKorean () { return pipe(new ORMAttributePipe<Me, String>(FIELD_DescriptionKorean));  }
        
        public PipeLine<From, String> toDescriptionThai () { return pipe(new ORMAttributePipe<Me, String>(FIELD_DescriptionThai));  }
        
        public PipeLine<From, Double> toZScoreWeight () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_ZScoreWeight));  }
        
        public PipeLine<From, Double> toZScoreWeight2 () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_ZScoreWeight2));  }
        
    }
    
    public boolean isTransientAttrib(String attribName)
    {
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

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

    public void assertValid ()
    {
    }


}

    
