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

    // Reference instance for the object
    public static final FactorLevelLink DUMMY_FactorLevelLink = new DummyFactorLevelLink ();

    // Static constants corresponding to field names
    
    public static final String FIELD_ClassCode = "ClassCode";
    public static final String FIELD_Notes = "Notes";
    public static final String FIELD_LeftAnnot = "LeftAnnot";
    public static final String FIELD_RightAnnot = "RightAnnot";
    public static final String FIELD_ZScoreWeight = "ZScoreWeight";
    public static final String FIELD_ZScoreWeight2 = "ZScoreWeight2";
    public static final String SINGLEREFERENCE_Level = "Level";
    public static final String BACKREF_Level = "";
    public static final String SINGLEREFERENCE_Factor = "Factor";
    public static final String BACKREF_Factor = "";

    // Static constants corresponding to searches
    public static final String SEARCH_All = "All";
    

    // Static constants corresponding to attribute helpers
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_ClassCode = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_Notes = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_LeftAnnot = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_RightAnnot = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_ZScoreWeight = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<FactorLevelLink> HELPER_ZScoreWeight2 = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private String _ClassCode;
    private String _Notes;
    private String _LeftAnnot;
    private String _RightAnnot;
    private Double _ZScoreWeight;
    private Double _ZScoreWeight2;
    

    // Private attributes corresponding to single references
    private SingleAssociation<FactorLevelLink, Level> _Level;
    private SingleAssociation<FactorLevelLink, Factor> _Factor;
    

    // Private attributes corresponding to multiple references
    

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

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_ClassCode_Validators;
    private static final AttributeValidator[] FIELD_Notes_Validators;
    private static final AttributeValidator[] FIELD_LeftAnnot_Validators;
    private static final AttributeValidator[] FIELD_RightAnnot_Validators;
    private static final AttributeValidator[] FIELD_ZScoreWeight_Validators;
    private static final AttributeValidator[] FIELD_ZScoreWeight2_Validators;
    

    // Arrays of behaviour decorators
    private static final FactorLevelLinkBehaviourDecorator[] FactorLevelLink_BehaviourDecorators;
    
    static
    {
        try
        {
            
            String tmp_Level = Level.BACKREF_Factors;
            String tmp_Factor = Factor.BACKREF_Levels;
            
            Map  validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));

            setupAssocMetaData_Level();
            setupAssocMetaData_Factor();
            FIELD_ClassCode_Validators = (AttributeValidator[])setupAttribMetaData_ClassCode(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Notes_Validators = (AttributeValidator[])setupAttribMetaData_Notes(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_ZScoreWeight_Validators = (AttributeValidator[])setupAttribMetaData_ZScoreWeight(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_ZScoreWeight2_Validators = (AttributeValidator[])setupAttribMetaData_ZScoreWeight2(validatorMapping).toArray (new AttributeValidator[0]);
            

            REFERENCE_FactorLevelLink.initialiseReference ();
            DUMMY_FactorLevelLink.initialiseReference ();
            FactorLevelLink_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(FactorLevelLink.class).toArray(new FactorLevelLinkBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

    
    // Meta Info setup
    private static void setupAssocMetaData_Level()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "Factors");
        metaInfo.put ("dbcol", "level_number");
        metaInfo.put ("name", "Level");
        metaInfo.put ("type", "Level");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorLevelLink.Level:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (SINGLEREFERENCE_Level, Collections.unmodifiableMap (metaInfo));
    }
    
    
    // Meta Info setup
    private static void setupAssocMetaData_Factor()
    {
        Map metaInfo = new HashMap ();

        metaInfo.put ("backreferenceName", "Levels");
        metaInfo.put ("dbcol", "factor_number");
        metaInfo.put ("name", "Factor");
        metaInfo.put ("type", "Factor");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for FactorLevelLink.Factor:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (SINGLEREFERENCE_Factor, Collections.unmodifiableMap (metaInfo));
    }
    
    
    // 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 FactorLevelLink.ClassCode:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_ClassCode, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(FactorLevelLink.class, "ClassCode", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for FactorLevelLink.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 FactorLevelLink.Notes:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_Notes, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(FactorLevelLink.class, "Notes", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for FactorLevelLink.Notes:", 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 FactorLevelLink.LeftAnnot:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_LeftAnnot, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(FactorLevelLink.class, "LeftAnnot", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for FactorLevelLink.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 FactorLevelLink.RightAnnot:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_RightAnnot, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(FactorLevelLink.class, "RightAnnot", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for FactorLevelLink.RightAnnot:", 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 FactorLevelLink.ZScoreWeight:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_ZScoreWeight, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(FactorLevelLink.class, "ZScoreWeight", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for FactorLevelLink.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 FactorLevelLink.ZScoreWeight2:", metaInfo);
        ATTRIBUTES_METADATA_FactorLevelLink.put (FIELD_ZScoreWeight2, Collections.unmodifiableMap (metaInfo));

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

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


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


    


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

        
        _ClassCode = (String)(HELPER_ClassCode.initialise (_ClassCode));
        _Notes = (String)(HELPER_Notes.initialise (_Notes));
        _LeftAnnot = (String)(HELPER_LeftAnnot.initialise (_LeftAnnot));
        _RightAnnot = (String)(HELPER_RightAnnot.initialise (_RightAnnot));
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.initialise (_ZScoreWeight));
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.initialise (_ZScoreWeight2));
    }


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

        _Level = new SingleAssociation<FactorLevelLink, Level> (this, SINGLEREFERENCE_Level, Level.MULTIPLEREFERENCE_Factors, Level.REFERENCE_Level, "rs_factor_hdr");
        _Factor = new SingleAssociation<FactorLevelLink, Factor> (this, SINGLEREFERENCE_Factor, Factor.MULTIPLEREFERENCE_Levels, Factor.REFERENCE_Factor, "rs_factor_hdr");
        
    }


    // Initialise the associations
    protected BaseBusinessClass initialiseReference ()
    {
        super.initialiseReference ();
        
        _Level = new SingleAssociation<FactorLevelLink, Level> (this, SINGLEREFERENCE_Level, Level.MULTIPLEREFERENCE_Factors, Level.REFERENCE_Level, "rs_factor_hdr");
        _Factor = new SingleAssociation<FactorLevelLink, Factor> (this, SINGLEREFERENCE_Factor, Factor.MULTIPLEREFERENCE_Levels, Factor.REFERENCE_Factor, "rs_factor_hdr");
        
        
        return this;
    }

    

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

            for (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getClassCode ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newClassCode = bhd.setClassCode ((FactorLevelLink)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_FactorLevelLink.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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getNotes ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newNotes = bhd.setNotes ((FactorLevelLink)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_FactorLevelLink.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 LeftAnnot
     */
    public String getLeftAnnot ()
    {
        assertValid();
        String valToReturn = _LeftAnnot;

            for (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getLeftAnnot ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newLeftAnnot = bhd.setLeftAnnot ((FactorLevelLink)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_FactorLevelLink.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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getRightAnnot ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newRightAnnot = bhd.setRightAnnot ((FactorLevelLink)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_FactorLevelLink.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 ZScoreWeight
     */
    public Double getZScoreWeight ()
    {
        assertValid();
        Double valToReturn = _ZScoreWeight;

            for (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getZScoreWeight ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newZScoreWeight = bhd.setZScoreWeight ((FactorLevelLink)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_FactorLevelLink.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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                valToReturn = bhd.getZScoreWeight2 ((FactorLevelLink)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 (FactorLevelLinkBehaviourDecorator bhd : FactorLevelLink_BehaviourDecorators)
            {
                newZScoreWeight2 = bhd.setZScoreWeight2 ((FactorLevelLink)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_FactorLevelLink.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 ();

        
        result.add("Level");
        
        result.add("Factor");
        

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


    public String getSingleAssocBackReference(String assocName)
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        else if (assocName.equals (SINGLEREFERENCE_Level))
        {
            return Level.MULTIPLEREFERENCE_Factors ;
        }else if (assocName.equals (SINGLEREFERENCE_Factor))
        {
            return Factor.MULTIPLEREFERENCE_Levels ;
        }
        else
        {
            return super.getSingleAssocBackReference (assocName);
        }
    }
    
    
    public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
    {
        if (assocName == null)
        {
            throw new RuntimeException ("Game over == null!");
        }
        else if (assocName.equals (SINGLEREFERENCE_Level))
        {
            return getLevel ();
        }else if (assocName.equals (SINGLEREFERENCE_Factor))
        {
            return getFactor ();
        }
        else
        {
            return super.getSingleAssoc (assocName);
        }
    }


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


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


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



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


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


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getLevelID ()
    {
        assertValid();
        
        if (_Level == null)
        {
            return null;
        }
        else
        {
            return _Level.getID ();
        }
    }

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


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



    
    public FieldWriteability getWriteability_Level ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    /**
     * Set the reference Level.  Checks to ensure a new value
     * has been supplied.  If so, marks the reference as altered and sets it.
     */
    public void setLevel (Level newLevel) throws StorageException, FieldException
    {
        

        if (_Level.wouldReferencedChange (newLevel))
        {
            assertValid();
            Debug.assertion (getWriteability_Level () != FieldWriteability.FALSE, "Assoc Level is not writeable");
            preLevelChange (newLevel);
            Level oldLevel = getLevel ();

                    if (oldLevel != null)
                    {
                        // This is to stop validation from triggering when we are removed
                        _Level.set (null);
                        oldLevel.removeFromFactors ((FactorLevelLink)(this));
                    }

                    _Level.set (newLevel);

                    if (newLevel != null)
                    {
                        newLevel.addToFactors ((FactorLevelLink)(this));
                    }
                
            postLevelChange ();
        }
    }

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


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


    /**
     * Get the object id for the referenced object.  Does not force a DB access.
     */
    public Long getFactorID ()
    {
        assertValid();
        
        if (_Factor == null)
        {
            return null;
        }
        else
        {
            return _Factor.getID ();
        }
    }

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


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



    
    public FieldWriteability getWriteability_Factor ()
    {
        return getFieldWritabilityUtil (FieldWriteability.TRUE);
    }
    
    
    /**
     * Set the reference Factor.  Checks to ensure a new value
     * has been supplied.  If so, marks the reference as altered and sets it.
     */
    public void setFactor (Factor newFactor) throws StorageException, FieldException
    {
        

        if (_Factor.wouldReferencedChange (newFactor))
        {
            assertValid();
            Debug.assertion (getWriteability_Factor () != FieldWriteability.FALSE, "Assoc Factor is not writeable");
            preFactorChange (newFactor);
            Factor oldFactor = getFactor ();

                    if (oldFactor != null)
                    {
                        // This is to stop validation from triggering when we are removed
                        _Factor.set (null);
                        oldFactor.removeFromLevels ((FactorLevelLink)(this));
                    }

                    _Factor.set (newFactor);

                    if (newFactor != null)
                    {
                        newFactor.addToLevels ((FactorLevelLink)(this));
                    }
                
            postFactorChange ();
        }
    }

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

        

        return result;
    }


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

        return super.getMultiAssocReferenceInstance(attribName);
    }


    public String getMultiAssocBackReference(String attribName)
    {
        

        return super.getMultiAssocBackReference(attribName);
    }


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

        return super.getMultiAssocCount(attribName);
    }


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

        return super.getMultiAssocAt(attribName, index);
    }


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

        super.addToMultiAssoc(attribName, newElement);
    }

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

        super.removeFromMultiAssoc(attribName, oldElement);
    }


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

        super.__loadMultiAssoc(attribName, elements);
    }


    protected boolean __isMultiAssocLoaded (String attribName)
    {
        

        return super.__isMultiAssocLoaded(attribName);
    }

    



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

                if (referenced != null)
                {
                    // Stop the callback
                    LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Factors from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Level.set (null);
                    referenced.removeFromFactors ((FactorLevelLink)this);
                }
            }
        
            // Ensure we are removed from any loaded multi-associations that aren't mandatory
            if (_Factor.isLoaded () || getTransaction ().isObjectLoaded (_Factor.getReferencedType (), getFactorID ()))
            {
                Factor  referenced = getFactor ();

                if (referenced != null)
                {
                    // Stop the callback
                    LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Levels from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Factor.set (null);
                    referenced.removeFromLevels ((FactorLevelLink)this);
                }
            }
        
        }
        catch (Exception e)
        {
            throw NestedException.wrap(e);
        }

        super.onDelete ();
    }


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


    public FactorLevelLink referenceInstance ()
    {
        return REFERENCE_FactorLevelLink;
    }


    public FactorLevelLink getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getFactorLevelLinkByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_FactorLevelLink;
    }


    public String getBaseSetName ()
    {
        return "rs_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   rs_factor_hdrPSet = allSets.getPersistentSet (myID, "rs_factor_hdr", myPSetStatus);

        rs_factor_hdrPSet.setAttrib (FIELD_ObjectID, myID);
        rs_factor_hdrPSet.setAttrib (FIELD_ClassCode, HELPER_ClassCode.toObject (_ClassCode)); //
        rs_factor_hdrPSet.setAttrib (FIELD_Notes, HELPER_Notes.toObject (_Notes)); //
        rs_factor_hdrPSet.setAttrib (FIELD_LeftAnnot, HELPER_LeftAnnot.toObject (_LeftAnnot)); //
        rs_factor_hdrPSet.setAttrib (FIELD_RightAnnot, HELPER_RightAnnot.toObject (_RightAnnot)); //
        rs_factor_hdrPSet.setAttrib (FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject (_ZScoreWeight)); //
        rs_factor_hdrPSet.setAttrib (FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject (_ZScoreWeight2)); //
        _Level.getPersistentSets (allSets);
        _Factor.getPersistentSets (allSets);
        
    }


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

        
        PersistentSet   rs_factor_hdrPSet = allSets.getPersistentSet (objectID, "rs_factor_hdr");

        _ClassCode = (String)(HELPER_ClassCode.fromObject (_ClassCode, rs_factor_hdrPSet.getAttrib (FIELD_ClassCode))); //
        _Notes = (String)(HELPER_Notes.fromObject (_Notes, rs_factor_hdrPSet.getAttrib (FIELD_Notes))); //
        _LeftAnnot = (String)(HELPER_LeftAnnot.fromObject (_LeftAnnot, rs_factor_hdrPSet.getAttrib (FIELD_LeftAnnot))); //
        _RightAnnot = (String)(HELPER_RightAnnot.fromObject (_RightAnnot, rs_factor_hdrPSet.getAttrib (FIELD_RightAnnot))); //
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.fromObject (_ZScoreWeight, rs_factor_hdrPSet.getAttrib (FIELD_ZScoreWeight))); //
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.fromObject (_ZScoreWeight2, rs_factor_hdrPSet.getAttrib (FIELD_ZScoreWeight2))); //
        _Level.setFromPersistentSets (objectID, allSets);
        _Factor.setFromPersistentSets (objectID, allSets);
        
    }





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

        if (other instanceof FactorLevelLink)
        {
            FactorLevelLink otherFactorLevelLink = (FactorLevelLink)other;
            
            try
            {
                setClassCode (otherFactorLevelLink.getClassCode ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setNotes (otherFactorLevelLink.getNotes ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLeftAnnot (otherFactorLevelLink.getLeftAnnot ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setRightAnnot (otherFactorLevelLink.getRightAnnot ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setZScoreWeight (otherFactorLevelLink.getZScoreWeight ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setZScoreWeight2 (otherFactorLevelLink.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 BaseFactorLevelLink)
        {
            BaseFactorLevelLink sourceFactorLevelLink = (BaseFactorLevelLink)(source);

            _ClassCode = sourceFactorLevelLink._ClassCode;
            _Notes = sourceFactorLevelLink._Notes;
            _LeftAnnot = sourceFactorLevelLink._LeftAnnot;
            _RightAnnot = sourceFactorLevelLink._RightAnnot;
            _ZScoreWeight = sourceFactorLevelLink._ZScoreWeight;
            _ZScoreWeight2 = sourceFactorLevelLink._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 BaseFactorLevelLink)
        {
            BaseFactorLevelLink sourceFactorLevelLink = (BaseFactorLevelLink)(source);

            _Level.copyFrom (sourceFactorLevelLink._Level, linkToGhosts);
            _Factor.copyFrom (sourceFactorLevelLink._Factor, linkToGhosts);
            
        }
    }


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

        if (source instanceof BaseFactorLevelLink)
        {
            BaseFactorLevelLink sourceFactorLevelLink = (BaseFactorLevelLink)(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);

        _ClassCode = (String)(HELPER_ClassCode.readExternal (_ClassCode, vals.get(FIELD_ClassCode))); //
        _Notes = (String)(HELPER_Notes.readExternal (_Notes, vals.get(FIELD_Notes))); //
        _LeftAnnot = (String)(HELPER_LeftAnnot.readExternal (_LeftAnnot, vals.get(FIELD_LeftAnnot))); //
        _RightAnnot = (String)(HELPER_RightAnnot.readExternal (_RightAnnot, vals.get(FIELD_RightAnnot))); //
        _ZScoreWeight = (Double)(HELPER_ZScoreWeight.readExternal (_ZScoreWeight, vals.get(FIELD_ZScoreWeight))); //
        _ZScoreWeight2 = (Double)(HELPER_ZScoreWeight2.readExternal (_ZScoreWeight2, vals.get(FIELD_ZScoreWeight2))); //
        _Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
        _Factor.readExternalData(vals.get(SINGLEREFERENCE_Factor));
        
    }


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

        vals.put (FIELD_ClassCode, HELPER_ClassCode.writeExternal (_ClassCode));
        vals.put (FIELD_Notes, HELPER_Notes.writeExternal (_Notes));
        vals.put (FIELD_LeftAnnot, HELPER_LeftAnnot.writeExternal (_LeftAnnot));
        vals.put (FIELD_RightAnnot, HELPER_RightAnnot.writeExternal (_RightAnnot));
        vals.put (FIELD_ZScoreWeight, HELPER_ZScoreWeight.writeExternal (_ZScoreWeight));
        vals.put (FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.writeExternal (_ZScoreWeight2));
        vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
        vals.put (SINGLEREFERENCE_Factor, _Factor.writeExternalData());
        
    }


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

        if (other instanceof BaseFactorLevelLink)
        {
            BaseFactorLevelLink otherFactorLevelLink = (BaseFactorLevelLink)(other);

            
            if (!HELPER_ClassCode.compare(this._ClassCode, otherFactorLevelLink._ClassCode))
            {
                listener.notifyFieldChange(this, other, FIELD_ClassCode, HELPER_ClassCode.toObject(this._ClassCode), HELPER_ClassCode.toObject(otherFactorLevelLink._ClassCode));
            }
            if (!HELPER_Notes.compare(this._Notes, otherFactorLevelLink._Notes))
            {
                listener.notifyFieldChange(this, other, FIELD_Notes, HELPER_Notes.toObject(this._Notes), HELPER_Notes.toObject(otherFactorLevelLink._Notes));
            }
            if (!HELPER_LeftAnnot.compare(this._LeftAnnot, otherFactorLevelLink._LeftAnnot))
            {
                listener.notifyFieldChange(this, other, FIELD_LeftAnnot, HELPER_LeftAnnot.toObject(this._LeftAnnot), HELPER_LeftAnnot.toObject(otherFactorLevelLink._LeftAnnot));
            }
            if (!HELPER_RightAnnot.compare(this._RightAnnot, otherFactorLevelLink._RightAnnot))
            {
                listener.notifyFieldChange(this, other, FIELD_RightAnnot, HELPER_RightAnnot.toObject(this._RightAnnot), HELPER_RightAnnot.toObject(otherFactorLevelLink._RightAnnot));
            }
            if (!HELPER_ZScoreWeight.compare(this._ZScoreWeight, otherFactorLevelLink._ZScoreWeight))
            {
                listener.notifyFieldChange(this, other, FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject(this._ZScoreWeight), HELPER_ZScoreWeight.toObject(otherFactorLevelLink._ZScoreWeight));
            }
            if (!HELPER_ZScoreWeight2.compare(this._ZScoreWeight2, otherFactorLevelLink._ZScoreWeight2))
            {
                listener.notifyFieldChange(this, other, FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject(this._ZScoreWeight2), HELPER_ZScoreWeight2.toObject(otherFactorLevelLink._ZScoreWeight2));
            }

            // Compare single assocs
            _Level.compare (otherFactorLevelLink._Level, listener);
            _Factor.compare (otherFactorLevelLink._Factor, listener);
            

            // Compare multiple assocs
            
        }
    }


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

        
    }


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

        visitor.visitField(this, FIELD_ClassCode, HELPER_ClassCode.toObject(getClassCode()));
        visitor.visitField(this, FIELD_Notes, HELPER_Notes.toObject(getNotes()));
        visitor.visitField(this, FIELD_LeftAnnot, HELPER_LeftAnnot.toObject(getLeftAnnot()));
        visitor.visitField(this, FIELD_RightAnnot, HELPER_RightAnnot.toObject(getRightAnnot()));
        visitor.visitField(this, FIELD_ZScoreWeight, HELPER_ZScoreWeight.toObject(getZScoreWeight()));
        visitor.visitField(this, FIELD_ZScoreWeight2, HELPER_ZScoreWeight2.toObject(getZScoreWeight2()));
        visitor.visitAssociation (_Level);
        visitor.visitAssociation (_Factor);
        
    }


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

        if (scope.includes (_Level))
        {
            visitor.visit (_Level);
        }
        if (scope.includes (_Factor))
        {
            visitor.visit (_Factor);
        }
        
    }


    public static FactorLevelLink createFactorLevelLink (ObjectTransaction transaction) throws StorageException
    {
        FactorLevelLink     result = new FactorLevelLink ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static FactorLevelLink getFactorLevelLinkByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (FactorLevelLink)(transaction.getObjectByID (REFERENCE_FactorLevelLink, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        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_LeftAnnot))
        {
            return filter.matches (getLeftAnnot ());
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return filter.matches (getRightAnnot ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight))
        {
            return filter.matches (getZScoreWeight ());
        }
        else if (attribName.equals (FIELD_ZScoreWeight2))
        {
            return filter.matches (getZScoreWeight2 ());
        }
        else if (attribName.equals (SINGLEREFERENCE_Level))
        {
            return filter.matches (getLevel ());
        }
        else if (attribName.equals (SINGLEREFERENCE_Factor))
        {
            return filter.matches (getFactor ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }


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

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

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

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

            
            public SearchAll andClassCode (QueryFilter<String> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.class_code", "ClassCode");
                return this;
            }
            
            public SearchAll andNotes (QueryFilter<String> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.factor_hdr_notes", "Notes");
                return this;
            }
            
            public SearchAll andLeftAnnot (QueryFilter<String> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.left_annot", "LeftAnnot");
                return this;
            }
            
            public SearchAll andRightAnnot (QueryFilter<String> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.right_annot", "RightAnnot");
                return this;
            }
            
            public SearchAll andZScoreWeight (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.z_score_wght", "ZScoreWeight");
                return this;
            }
            
            public SearchAll andZScoreWeight2 (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.z_score_wght_2", "ZScoreWeight2");
                return this;
            }
            
            public SearchAll andLevel (QueryFilter<Level> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.level_number", "Level");
                return this;
            }
            
            public SearchAll andFactor (QueryFilter<Factor> filter)
            {
                filter.addFilter (context, "rs_factor_hdr.factor_number", "Factor");
                return this;
            }
            
                public FactorLevelLink[]
             search (ObjectTransaction transaction) throws StorageException
        {
            
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_FactorLevelLink, SEARCH_All, criteria);
            Set<FactorLevelLink>   typedResults = new LinkedHashSet <FactorLevelLink> ();
            for (BaseBusinessClass bbcResult : results)
            {
                FactorLevelLink aResult = (FactorLevelLink)bbcResult;
                
                typedResults.add (aResult);
            }
            
                    return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new FactorLevelLink[0]);
                            
        }
    }

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



    public Object getAttribute (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        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_LeftAnnot))
        {
            return HELPER_LeftAnnot.toObject (getLeftAnnot ());
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return HELPER_RightAnnot.toObject (getRightAnnot ());
        }
        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_ClassCode))
        {
            return HELPER_ClassCode;
        }
        else if (attribName.equals (FIELD_Notes))
        {
            return HELPER_Notes;
        }
        else if (attribName.equals (FIELD_LeftAnnot))
        {
            return HELPER_LeftAnnot;
        }
        else if (attribName.equals (FIELD_RightAnnot))
        {
            return HELPER_RightAnnot;
        }
        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_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_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_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_ClassCode))
        {
            return getWriteability_ClassCode ();
        }
        else if (fieldName.equals (FIELD_Notes))
        {
            return getWriteability_Notes ();
        }
        else if (fieldName.equals (FIELD_LeftAnnot))
        {
            return getWriteability_LeftAnnot ();
        }
        else if (fieldName.equals (FIELD_RightAnnot))
        {
            return getWriteability_RightAnnot ();
        }
        else if (fieldName.equals (FIELD_ZScoreWeight))
        {
            return getWriteability_ZScoreWeight ();
        }
        else if (fieldName.equals (FIELD_ZScoreWeight2))
        {
            return getWriteability_ZScoreWeight2 ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Level))
        {
            return getWriteability_Level ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Factor))
        {
            return getWriteability_Factor ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        
            if (getWriteability_ClassCode () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_ClassCode);
            }
        
            if (getWriteability_Notes () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_Notes);
            }
        
            if (getWriteability_LeftAnnot () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_LeftAnnot);
            }
        
            if (getWriteability_RightAnnot () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_RightAnnot);
            }
        
            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_ClassCode.getAttribObject (getClass (), _ClassCode, false, FIELD_ClassCode));
        result.add(HELPER_Notes.getAttribObject (getClass (), _Notes, false, FIELD_Notes));
        result.add(HELPER_LeftAnnot.getAttribObject (getClass (), _LeftAnnot, false, FIELD_LeftAnnot));
        result.add(HELPER_RightAnnot.getAttribObject (getClass (), _RightAnnot, false, FIELD_RightAnnot));
        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_FactorLevelLink.containsKey (attribute))
        {
            return (Map)ATTRIBUTES_METADATA_FactorLevelLink.get (attribute);
        }
        else
        {
            return super.getAttributeMetadata (attribute);
        }
    }


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

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

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

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

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

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

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

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

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

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

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

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

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

    }

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

        public FactorLevelLinkPipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("ClassCode"))
            {
                return toClassCode ();
            }                
            if (name.equals ("Notes"))
            {
                return toNotes ();
            }                
            if (name.equals ("LeftAnnot"))
            {
                return toLeftAnnot ();
            }                
            if (name.equals ("RightAnnot"))
            {
                return toRightAnnot ();
            }                
            if (name.equals ("ZScoreWeight"))
            {
                return toZScoreWeight ();
            }                
            if (name.equals ("ZScoreWeight2"))
            {
                return toZScoreWeight2 ();
            }                
            if (name.equals ("Level"))
            {
                return toLevel ();
            }                
            if (name.equals ("Factor"))
            {
                return toFactor ();
            }                
            
            
            return super.to(name);
        }
        
        
        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, 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, Double> toZScoreWeight () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_ZScoreWeight));  }
        
        public PipeLine<From, Double> toZScoreWeight2 () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_ZScoreWeight2));  }
        public Level.LevelPipeLineFactory<From, Level> toLevel () { return toLevel (Filter.ALL); }

        public Level.LevelPipeLineFactory<From, Level> toLevel (Filter<Level> filter) 
        { 
            return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_Level, filter)); 
        }
        public Factor.FactorPipeLineFactory<From, Factor> toFactor () { return toFactor (Filter.ALL); }

        public Factor.FactorPipeLineFactory<From, Factor> toFactor (Filter<Factor> filter) 
        { 
            return Factor.REFERENCE_Factor.new FactorPipeLineFactory<From, Factor> (this, new ORMSingleAssocPipe<Me, Factor>(SINGLEREFERENCE_Factor, filter)); 
        }
        
    }
    
    public boolean isTransientAttrib(String attribName)
    {
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

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

    public void assertValid ()
    {
    }


    public Level getLevel () throws StorageException
    {
        return (Level)(Level.DUMMY_Level);
    }


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

    public Factor getFactor () throws StorageException
    {
        return (Factor)(Factor.DUMMY_Factor);
    }


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

}

    
