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


    package performa.orm;

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

import performa.orm.types.*;



public abstract class BaseClassNormalisation extends BaseBusinessClass
{
    // Reference instance for the object
    public static final ClassNormalisation REFERENCE_ClassNormalisation = new ClassNormalisation ();

    // Reference instance for the object
    public static final ClassNormalisation DUMMY_ClassNormalisation = new DummyClassNormalisation ();

    // Static constants corresponding to field names
    
    public static final String FIELD_FactorClass = "FactorClass";
    public static final String FIELD_MeanScore = "MeanScore";
    public static final String FIELD_MaxScore = "MaxScore";
    public static final String FIELD_MinScore = "MinScore";
    public static final String FIELD_StddevScore = "StddevScore";
    public static final String FIELD_LeftMeanScore = "LeftMeanScore";
    public static final String FIELD_RightMeanScore = "RightMeanScore";
    public static final String FIELD_WghtMeanScore = "WghtMeanScore";
    public static final String FIELD_WghtStddevScore = "WghtStddevScore";
    public static final String FIELD_WghtLeftMeanScore = "WghtLeftMeanScore";
    public static final String FIELD_WghtRightMeanScore = "WghtRightMeanScore";
    public static final String SINGLEREFERENCE_Level = "Level";
    public static final String BACKREF_Level = "";

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

    // Static constants corresponding to attribute helpers
    private static final EnumeratedAttributeHelper<ClassNormalisation, FactorClass> HELPER_FactorClass =  new EnumeratedAttributeHelper<ClassNormalisation, FactorClass> (FactorClass.FACTORY_FactorClass);
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_MeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_MaxScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_MinScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_StddevScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_LeftMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_RightMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_WghtMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_WghtStddevScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_WghtLeftMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<ClassNormalisation> HELPER_WghtRightMeanScore = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private FactorClass _FactorClass;
    private Double _MeanScore;
    private Double _MaxScore;
    private Double _MinScore;
    private Double _StddevScore;
    private Double _LeftMeanScore;
    private Double _RightMeanScore;
    private Double _WghtMeanScore;
    private Double _WghtStddevScore;
    private Double _WghtLeftMeanScore;
    private Double _WghtRightMeanScore;
    

    // Private attributes corresponding to single references
    private SingleAssociation<ClassNormalisation, Level> _Level;
    

    // Private attributes corresponding to multiple references
    

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

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_FactorClass_Validators;
    private static final AttributeValidator[] FIELD_MeanScore_Validators;
    private static final AttributeValidator[] FIELD_MaxScore_Validators;
    private static final AttributeValidator[] FIELD_MinScore_Validators;
    private static final AttributeValidator[] FIELD_StddevScore_Validators;
    private static final AttributeValidator[] FIELD_LeftMeanScore_Validators;
    private static final AttributeValidator[] FIELD_RightMeanScore_Validators;
    private static final AttributeValidator[] FIELD_WghtMeanScore_Validators;
    private static final AttributeValidator[] FIELD_WghtStddevScore_Validators;
    private static final AttributeValidator[] FIELD_WghtLeftMeanScore_Validators;
    private static final AttributeValidator[] FIELD_WghtRightMeanScore_Validators;
    

    // Arrays of behaviour decorators
    private static final ClassNormalisationBehaviourDecorator[] ClassNormalisation_BehaviourDecorators;
    
    static
    {
        try
        {
            
            String tmp_Level = Level.BACKREF_ClassNormalisations;
            
            Map  validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));

            setupAssocMetaData_Level();
            FIELD_FactorClass_Validators = (AttributeValidator[])setupAttribMetaData_FactorClass(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_MeanScore_Validators = (AttributeValidator[])setupAttribMetaData_MeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_MaxScore_Validators = (AttributeValidator[])setupAttribMetaData_MaxScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_MinScore_Validators = (AttributeValidator[])setupAttribMetaData_MinScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_StddevScore_Validators = (AttributeValidator[])setupAttribMetaData_StddevScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_LeftMeanScore_Validators = (AttributeValidator[])setupAttribMetaData_LeftMeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_RightMeanScore_Validators = (AttributeValidator[])setupAttribMetaData_RightMeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_WghtMeanScore_Validators = (AttributeValidator[])setupAttribMetaData_WghtMeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_WghtStddevScore_Validators = (AttributeValidator[])setupAttribMetaData_WghtStddevScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_WghtLeftMeanScore_Validators = (AttributeValidator[])setupAttribMetaData_WghtLeftMeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_WghtRightMeanScore_Validators = (AttributeValidator[])setupAttribMetaData_WghtRightMeanScore(validatorMapping).toArray (new AttributeValidator[0]);
            

            REFERENCE_ClassNormalisation.initialiseReference ();
            DUMMY_ClassNormalisation.initialiseReference ();
            ClassNormalisation_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(ClassNormalisation.class).toArray(new ClassNormalisationBehaviourDecorator[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", "ClassNormalisations");
        metaInfo.put ("dbcol", "level_number");
        metaInfo.put ("name", "Level");
        metaInfo.put ("type", "Level");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.Level:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (SINGLEREFERENCE_Level, Collections.unmodifiableMap (metaInfo));
    }
    
    
    // Meta Info setup
    private static List setupAttribMetaData_FactorClass(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
        metaInfo.put ("dbcol", "class_code");
        metaInfo.put ("name", "FactorClass");
        metaInfo.put ("type", "FactorClass");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.FactorClass:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_FactorClass, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "mean_score");
        metaInfo.put ("name", "MeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.MeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_MeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "max_score");
        metaInfo.put ("name", "MaxScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.MaxScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_MaxScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "min_score");
        metaInfo.put ("name", "MinScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.MinScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_MinScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "stddev_score");
        metaInfo.put ("name", "StddevScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.StddevScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_StddevScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "left_mean_score");
        metaInfo.put ("name", "LeftMeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.LeftMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_LeftMeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "right_mean_score");
        metaInfo.put ("name", "RightMeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.RightMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_RightMeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "wght_mean_score");
        metaInfo.put ("name", "WghtMeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.WghtMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_WghtMeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "wght_stddev_score");
        metaInfo.put ("name", "WghtStddevScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.WghtStddevScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_WghtStddevScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "wght_left_mean_score");
        metaInfo.put ("name", "WghtLeftMeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.WghtLeftMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_WghtLeftMeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "wght_right_mean_score");
        metaInfo.put ("name", "WghtRightMeanScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ClassNormalisation.WghtRightMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_ClassNormalisation.put (FIELD_WghtRightMeanScore, Collections.unmodifiableMap (metaInfo));

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

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


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


    


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

        
        _FactorClass = (FactorClass)(HELPER_FactorClass.initialise (_FactorClass));
        _MeanScore = (Double)(HELPER_MeanScore.initialise (_MeanScore));
        _MaxScore = (Double)(HELPER_MaxScore.initialise (_MaxScore));
        _MinScore = (Double)(HELPER_MinScore.initialise (_MinScore));
        _StddevScore = (Double)(HELPER_StddevScore.initialise (_StddevScore));
        _LeftMeanScore = (Double)(HELPER_LeftMeanScore.initialise (_LeftMeanScore));
        _RightMeanScore = (Double)(HELPER_RightMeanScore.initialise (_RightMeanScore));
        _WghtMeanScore = (Double)(HELPER_WghtMeanScore.initialise (_WghtMeanScore));
        _WghtStddevScore = (Double)(HELPER_WghtStddevScore.initialise (_WghtStddevScore));
        _WghtLeftMeanScore = (Double)(HELPER_WghtLeftMeanScore.initialise (_WghtLeftMeanScore));
        _WghtRightMeanScore = (Double)(HELPER_WghtRightMeanScore.initialise (_WghtRightMeanScore));
    }


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

        _Level = new SingleAssociation<ClassNormalisation, Level> (this, SINGLEREFERENCE_Level, Level.MULTIPLEREFERENCE_ClassNormalisations, Level.REFERENCE_Level, "tl_class_norm");
        
    }


    // Initialise the associations
    protected BaseBusinessClass initialiseReference ()
    {
        super.initialiseReference ();
        
        _Level = new SingleAssociation<ClassNormalisation, Level> (this, SINGLEREFERENCE_Level, Level.MULTIPLEREFERENCE_ClassNormalisations, Level.REFERENCE_Level, "tl_class_norm");
        
        
        return this;
    }

    

    /**
     * Get the attribute FactorClass
     */
    public FactorClass getFactorClass ()
    {
        assertValid();
        FactorClass valToReturn = _FactorClass;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getFactorClass ((ClassNormalisation)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 preFactorClassChange (FactorClass newFactorClass) 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 postFactorClassChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute FactorClass.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setFactorClass (FactorClass newFactorClass) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_FactorClass.compare (_FactorClass, newFactorClass);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newFactorClass = bhd.setFactorClass ((ClassNormalisation)this, newFactorClass);
                oldAndNewIdentical = HELPER_FactorClass.compare (_FactorClass, newFactorClass);
            }

            

            if (FIELD_FactorClass_Validators.length > 0)
            {
                Object newFactorClassObj = HELPER_FactorClass.toObject (newFactorClass);

                if (newFactorClassObj != null)
                {
                    int     loopMax = FIELD_FactorClass_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_FactorClass);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_FactorClass () != FieldWriteability.FALSE, "Field  FactorClass is not writeable");
            preFactorClassChange (newFactorClass);
            markFieldChange (FIELD_FactorClass);
            _FactorClass = newFactorClass;            
            postFieldChange (FIELD_FactorClass);
            postFactorClassChange ();
        }
    }

    /**
     * Get the attribute MeanScore
     */
    public Double getMeanScore ()
    {
        assertValid();
        Double valToReturn = _MeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMeanScore ((ClassNormalisation)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 preMeanScoreChange (Double newMeanScore) 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 postMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMeanScore (Double newMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MeanScore.compare (_MeanScore, newMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newMeanScore = bhd.setMeanScore ((ClassNormalisation)this, newMeanScore);
                oldAndNewIdentical = HELPER_MeanScore.compare (_MeanScore, newMeanScore);
            }

            

            if (FIELD_MeanScore_Validators.length > 0)
            {
                Object newMeanScoreObj = HELPER_MeanScore.toObject (newMeanScore);

                if (newMeanScoreObj != null)
                {
                    int     loopMax = FIELD_MeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_MeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MeanScore () != FieldWriteability.FALSE, "Field  MeanScore is not writeable");
            preMeanScoreChange (newMeanScore);
            markFieldChange (FIELD_MeanScore);
            _MeanScore = newMeanScore;            
            postFieldChange (FIELD_MeanScore);
            postMeanScoreChange ();
        }
    }

    /**
     * Get the attribute MaxScore
     */
    public Double getMaxScore ()
    {
        assertValid();
        Double valToReturn = _MaxScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMaxScore ((ClassNormalisation)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 preMaxScoreChange (Double newMaxScore) 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 postMaxScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MaxScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMaxScore (Double newMaxScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MaxScore.compare (_MaxScore, newMaxScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newMaxScore = bhd.setMaxScore ((ClassNormalisation)this, newMaxScore);
                oldAndNewIdentical = HELPER_MaxScore.compare (_MaxScore, newMaxScore);
            }

            

            if (FIELD_MaxScore_Validators.length > 0)
            {
                Object newMaxScoreObj = HELPER_MaxScore.toObject (newMaxScore);

                if (newMaxScoreObj != null)
                {
                    int     loopMax = FIELD_MaxScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_MaxScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MaxScore () != FieldWriteability.FALSE, "Field  MaxScore is not writeable");
            preMaxScoreChange (newMaxScore);
            markFieldChange (FIELD_MaxScore);
            _MaxScore = newMaxScore;            
            postFieldChange (FIELD_MaxScore);
            postMaxScoreChange ();
        }
    }

    /**
     * Get the attribute MinScore
     */
    public Double getMinScore ()
    {
        assertValid();
        Double valToReturn = _MinScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMinScore ((ClassNormalisation)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 preMinScoreChange (Double newMinScore) 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 postMinScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MinScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMinScore (Double newMinScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MinScore.compare (_MinScore, newMinScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newMinScore = bhd.setMinScore ((ClassNormalisation)this, newMinScore);
                oldAndNewIdentical = HELPER_MinScore.compare (_MinScore, newMinScore);
            }

            

            if (FIELD_MinScore_Validators.length > 0)
            {
                Object newMinScoreObj = HELPER_MinScore.toObject (newMinScore);

                if (newMinScoreObj != null)
                {
                    int     loopMax = FIELD_MinScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_MinScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MinScore () != FieldWriteability.FALSE, "Field  MinScore is not writeable");
            preMinScoreChange (newMinScore);
            markFieldChange (FIELD_MinScore);
            _MinScore = newMinScore;            
            postFieldChange (FIELD_MinScore);
            postMinScoreChange ();
        }
    }

    /**
     * Get the attribute StddevScore
     */
    public Double getStddevScore ()
    {
        assertValid();
        Double valToReturn = _StddevScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getStddevScore ((ClassNormalisation)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 preStddevScoreChange (Double newStddevScore) 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 postStddevScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute StddevScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setStddevScore (Double newStddevScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_StddevScore.compare (_StddevScore, newStddevScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newStddevScore = bhd.setStddevScore ((ClassNormalisation)this, newStddevScore);
                oldAndNewIdentical = HELPER_StddevScore.compare (_StddevScore, newStddevScore);
            }

            

            if (FIELD_StddevScore_Validators.length > 0)
            {
                Object newStddevScoreObj = HELPER_StddevScore.toObject (newStddevScore);

                if (newStddevScoreObj != null)
                {
                    int     loopMax = FIELD_StddevScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_StddevScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_StddevScore () != FieldWriteability.FALSE, "Field  StddevScore is not writeable");
            preStddevScoreChange (newStddevScore);
            markFieldChange (FIELD_StddevScore);
            _StddevScore = newStddevScore;            
            postFieldChange (FIELD_StddevScore);
            postStddevScoreChange ();
        }
    }

    /**
     * Get the attribute LeftMeanScore
     */
    public Double getLeftMeanScore ()
    {
        assertValid();
        Double valToReturn = _LeftMeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getLeftMeanScore ((ClassNormalisation)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 preLeftMeanScoreChange (Double newLeftMeanScore) 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 postLeftMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute LeftMeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setLeftMeanScore (Double newLeftMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_LeftMeanScore.compare (_LeftMeanScore, newLeftMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newLeftMeanScore = bhd.setLeftMeanScore ((ClassNormalisation)this, newLeftMeanScore);
                oldAndNewIdentical = HELPER_LeftMeanScore.compare (_LeftMeanScore, newLeftMeanScore);
            }

            

            if (FIELD_LeftMeanScore_Validators.length > 0)
            {
                Object newLeftMeanScoreObj = HELPER_LeftMeanScore.toObject (newLeftMeanScore);

                if (newLeftMeanScoreObj != null)
                {
                    int     loopMax = FIELD_LeftMeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_LeftMeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_LeftMeanScore () != FieldWriteability.FALSE, "Field  LeftMeanScore is not writeable");
            preLeftMeanScoreChange (newLeftMeanScore);
            markFieldChange (FIELD_LeftMeanScore);
            _LeftMeanScore = newLeftMeanScore;            
            postFieldChange (FIELD_LeftMeanScore);
            postLeftMeanScoreChange ();
        }
    }

    /**
     * Get the attribute RightMeanScore
     */
    public Double getRightMeanScore ()
    {
        assertValid();
        Double valToReturn = _RightMeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getRightMeanScore ((ClassNormalisation)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 preRightMeanScoreChange (Double newRightMeanScore) 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 postRightMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute RightMeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setRightMeanScore (Double newRightMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_RightMeanScore.compare (_RightMeanScore, newRightMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newRightMeanScore = bhd.setRightMeanScore ((ClassNormalisation)this, newRightMeanScore);
                oldAndNewIdentical = HELPER_RightMeanScore.compare (_RightMeanScore, newRightMeanScore);
            }

            

            if (FIELD_RightMeanScore_Validators.length > 0)
            {
                Object newRightMeanScoreObj = HELPER_RightMeanScore.toObject (newRightMeanScore);

                if (newRightMeanScoreObj != null)
                {
                    int     loopMax = FIELD_RightMeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_RightMeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_RightMeanScore () != FieldWriteability.FALSE, "Field  RightMeanScore is not writeable");
            preRightMeanScoreChange (newRightMeanScore);
            markFieldChange (FIELD_RightMeanScore);
            _RightMeanScore = newRightMeanScore;            
            postFieldChange (FIELD_RightMeanScore);
            postRightMeanScoreChange ();
        }
    }

    /**
     * Get the attribute WghtMeanScore
     */
    public Double getWghtMeanScore ()
    {
        assertValid();
        Double valToReturn = _WghtMeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtMeanScore ((ClassNormalisation)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 preWghtMeanScoreChange (Double newWghtMeanScore) 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 postWghtMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute WghtMeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setWghtMeanScore (Double newWghtMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_WghtMeanScore.compare (_WghtMeanScore, newWghtMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newWghtMeanScore = bhd.setWghtMeanScore ((ClassNormalisation)this, newWghtMeanScore);
                oldAndNewIdentical = HELPER_WghtMeanScore.compare (_WghtMeanScore, newWghtMeanScore);
            }

            

            if (FIELD_WghtMeanScore_Validators.length > 0)
            {
                Object newWghtMeanScoreObj = HELPER_WghtMeanScore.toObject (newWghtMeanScore);

                if (newWghtMeanScoreObj != null)
                {
                    int     loopMax = FIELD_WghtMeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_WghtMeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_WghtMeanScore () != FieldWriteability.FALSE, "Field  WghtMeanScore is not writeable");
            preWghtMeanScoreChange (newWghtMeanScore);
            markFieldChange (FIELD_WghtMeanScore);
            _WghtMeanScore = newWghtMeanScore;            
            postFieldChange (FIELD_WghtMeanScore);
            postWghtMeanScoreChange ();
        }
    }

    /**
     * Get the attribute WghtStddevScore
     */
    public Double getWghtStddevScore ()
    {
        assertValid();
        Double valToReturn = _WghtStddevScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtStddevScore ((ClassNormalisation)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 preWghtStddevScoreChange (Double newWghtStddevScore) 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 postWghtStddevScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute WghtStddevScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setWghtStddevScore (Double newWghtStddevScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_WghtStddevScore.compare (_WghtStddevScore, newWghtStddevScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newWghtStddevScore = bhd.setWghtStddevScore ((ClassNormalisation)this, newWghtStddevScore);
                oldAndNewIdentical = HELPER_WghtStddevScore.compare (_WghtStddevScore, newWghtStddevScore);
            }

            

            if (FIELD_WghtStddevScore_Validators.length > 0)
            {
                Object newWghtStddevScoreObj = HELPER_WghtStddevScore.toObject (newWghtStddevScore);

                if (newWghtStddevScoreObj != null)
                {
                    int     loopMax = FIELD_WghtStddevScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_WghtStddevScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_WghtStddevScore () != FieldWriteability.FALSE, "Field  WghtStddevScore is not writeable");
            preWghtStddevScoreChange (newWghtStddevScore);
            markFieldChange (FIELD_WghtStddevScore);
            _WghtStddevScore = newWghtStddevScore;            
            postFieldChange (FIELD_WghtStddevScore);
            postWghtStddevScoreChange ();
        }
    }

    /**
     * Get the attribute WghtLeftMeanScore
     */
    public Double getWghtLeftMeanScore ()
    {
        assertValid();
        Double valToReturn = _WghtLeftMeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtLeftMeanScore ((ClassNormalisation)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 preWghtLeftMeanScoreChange (Double newWghtLeftMeanScore) 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 postWghtLeftMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute WghtLeftMeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setWghtLeftMeanScore (Double newWghtLeftMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_WghtLeftMeanScore.compare (_WghtLeftMeanScore, newWghtLeftMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newWghtLeftMeanScore = bhd.setWghtLeftMeanScore ((ClassNormalisation)this, newWghtLeftMeanScore);
                oldAndNewIdentical = HELPER_WghtLeftMeanScore.compare (_WghtLeftMeanScore, newWghtLeftMeanScore);
            }

            

            if (FIELD_WghtLeftMeanScore_Validators.length > 0)
            {
                Object newWghtLeftMeanScoreObj = HELPER_WghtLeftMeanScore.toObject (newWghtLeftMeanScore);

                if (newWghtLeftMeanScoreObj != null)
                {
                    int     loopMax = FIELD_WghtLeftMeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_WghtLeftMeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_WghtLeftMeanScore () != FieldWriteability.FALSE, "Field  WghtLeftMeanScore is not writeable");
            preWghtLeftMeanScoreChange (newWghtLeftMeanScore);
            markFieldChange (FIELD_WghtLeftMeanScore);
            _WghtLeftMeanScore = newWghtLeftMeanScore;            
            postFieldChange (FIELD_WghtLeftMeanScore);
            postWghtLeftMeanScoreChange ();
        }
    }

    /**
     * Get the attribute WghtRightMeanScore
     */
    public Double getWghtRightMeanScore ()
    {
        assertValid();
        Double valToReturn = _WghtRightMeanScore;

            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtRightMeanScore ((ClassNormalisation)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 preWghtRightMeanScoreChange (Double newWghtRightMeanScore) 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 postWghtRightMeanScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute WghtRightMeanScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setWghtRightMeanScore (Double newWghtRightMeanScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_WghtRightMeanScore.compare (_WghtRightMeanScore, newWghtRightMeanScore);
        
        try
        {
            for (ClassNormalisationBehaviourDecorator bhd : ClassNormalisation_BehaviourDecorators)
            {
                newWghtRightMeanScore = bhd.setWghtRightMeanScore ((ClassNormalisation)this, newWghtRightMeanScore);
                oldAndNewIdentical = HELPER_WghtRightMeanScore.compare (_WghtRightMeanScore, newWghtRightMeanScore);
            }

            

            if (FIELD_WghtRightMeanScore_Validators.length > 0)
            {
                Object newWghtRightMeanScoreObj = HELPER_WghtRightMeanScore.toObject (newWghtRightMeanScore);

                if (newWghtRightMeanScoreObj != null)
                {
                    int     loopMax = FIELD_WghtRightMeanScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_ClassNormalisation.get (FIELD_WghtRightMeanScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_WghtRightMeanScore () != FieldWriteability.FALSE, "Field  WghtRightMeanScore is not writeable");
            preWghtRightMeanScoreChange (newWghtRightMeanScore);
            markFieldChange (FIELD_WghtRightMeanScore);
            _WghtRightMeanScore = newWghtRightMeanScore;            
            postFieldChange (FIELD_WghtRightMeanScore);
            postWghtRightMeanScoreChange ();
        }
    }



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

        
        result.add("Level");
        

        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
        {
            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_ClassNormalisations ;
        }
        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
        {
            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
        {
            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
        {
            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
        {
            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 ClassNormalisation:", 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.removeFromClassNormalisations ((ClassNormalisation)(this));
                    }

                    _Level.set (newLevel);

                    if (newLevel != null)
                    {
                        newLevel.addToClassNormalisations ((ClassNormalisation)(this));
                    }
                
            postLevelChange ();
        }
    }

    /**
     * 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 ClassNormalisations from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Level.set (null);
                    referenced.removeFromClassNormalisations ((ClassNormalisation)this);
                }
            }
        
        }
        catch (Exception e)
        {
            throw NestedException.wrap(e);
        }

        super.onDelete ();
    }


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


    public ClassNormalisation referenceInstance ()
    {
        return REFERENCE_ClassNormalisation;
    }


    public ClassNormalisation getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getClassNormalisationByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_ClassNormalisation;
    }


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





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

        super.getPersistentSets (allSets);

        
        PersistentSet   tl_class_normPSet = allSets.getPersistentSet (myID, "tl_class_norm", myPSetStatus);

        tl_class_normPSet.setAttrib (FIELD_ObjectID, myID);
        tl_class_normPSet.setAttrib (FIELD_FactorClass, HELPER_FactorClass.toObject (_FactorClass)); //
        tl_class_normPSet.setAttrib (FIELD_MeanScore, HELPER_MeanScore.toObject (_MeanScore)); //
        tl_class_normPSet.setAttrib (FIELD_MaxScore, HELPER_MaxScore.toObject (_MaxScore)); //
        tl_class_normPSet.setAttrib (FIELD_MinScore, HELPER_MinScore.toObject (_MinScore)); //
        tl_class_normPSet.setAttrib (FIELD_StddevScore, HELPER_StddevScore.toObject (_StddevScore)); //
        tl_class_normPSet.setAttrib (FIELD_LeftMeanScore, HELPER_LeftMeanScore.toObject (_LeftMeanScore)); //
        tl_class_normPSet.setAttrib (FIELD_RightMeanScore, HELPER_RightMeanScore.toObject (_RightMeanScore)); //
        tl_class_normPSet.setAttrib (FIELD_WghtMeanScore, HELPER_WghtMeanScore.toObject (_WghtMeanScore)); //
        tl_class_normPSet.setAttrib (FIELD_WghtStddevScore, HELPER_WghtStddevScore.toObject (_WghtStddevScore)); //
        tl_class_normPSet.setAttrib (FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.toObject (_WghtLeftMeanScore)); //
        tl_class_normPSet.setAttrib (FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.toObject (_WghtRightMeanScore)); //
        _Level.getPersistentSets (allSets);
        
    }


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

        
        PersistentSet   tl_class_normPSet = allSets.getPersistentSet (objectID, "tl_class_norm");

        _FactorClass = (FactorClass)(HELPER_FactorClass.fromObject (_FactorClass, tl_class_normPSet.getAttrib (FIELD_FactorClass))); //
        _MeanScore = (Double)(HELPER_MeanScore.fromObject (_MeanScore, tl_class_normPSet.getAttrib (FIELD_MeanScore))); //
        _MaxScore = (Double)(HELPER_MaxScore.fromObject (_MaxScore, tl_class_normPSet.getAttrib (FIELD_MaxScore))); //
        _MinScore = (Double)(HELPER_MinScore.fromObject (_MinScore, tl_class_normPSet.getAttrib (FIELD_MinScore))); //
        _StddevScore = (Double)(HELPER_StddevScore.fromObject (_StddevScore, tl_class_normPSet.getAttrib (FIELD_StddevScore))); //
        _LeftMeanScore = (Double)(HELPER_LeftMeanScore.fromObject (_LeftMeanScore, tl_class_normPSet.getAttrib (FIELD_LeftMeanScore))); //
        _RightMeanScore = (Double)(HELPER_RightMeanScore.fromObject (_RightMeanScore, tl_class_normPSet.getAttrib (FIELD_RightMeanScore))); //
        _WghtMeanScore = (Double)(HELPER_WghtMeanScore.fromObject (_WghtMeanScore, tl_class_normPSet.getAttrib (FIELD_WghtMeanScore))); //
        _WghtStddevScore = (Double)(HELPER_WghtStddevScore.fromObject (_WghtStddevScore, tl_class_normPSet.getAttrib (FIELD_WghtStddevScore))); //
        _WghtLeftMeanScore = (Double)(HELPER_WghtLeftMeanScore.fromObject (_WghtLeftMeanScore, tl_class_normPSet.getAttrib (FIELD_WghtLeftMeanScore))); //
        _WghtRightMeanScore = (Double)(HELPER_WghtRightMeanScore.fromObject (_WghtRightMeanScore, tl_class_normPSet.getAttrib (FIELD_WghtRightMeanScore))); //
        _Level.setFromPersistentSets (objectID, allSets);
        
    }





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

        if (other instanceof ClassNormalisation)
        {
            ClassNormalisation otherClassNormalisation = (ClassNormalisation)other;
            
            try
            {
                setFactorClass (otherClassNormalisation.getFactorClass ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMeanScore (otherClassNormalisation.getMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMaxScore (otherClassNormalisation.getMaxScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMinScore (otherClassNormalisation.getMinScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setStddevScore (otherClassNormalisation.getStddevScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLeftMeanScore (otherClassNormalisation.getLeftMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setRightMeanScore (otherClassNormalisation.getRightMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtMeanScore (otherClassNormalisation.getWghtMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtStddevScore (otherClassNormalisation.getWghtStddevScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtLeftMeanScore (otherClassNormalisation.getWghtLeftMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtRightMeanScore (otherClassNormalisation.getWghtRightMeanScore ());
            }
            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 BaseClassNormalisation)
        {
            BaseClassNormalisation sourceClassNormalisation = (BaseClassNormalisation)(source);

            _FactorClass = sourceClassNormalisation._FactorClass;
            _MeanScore = sourceClassNormalisation._MeanScore;
            _MaxScore = sourceClassNormalisation._MaxScore;
            _MinScore = sourceClassNormalisation._MinScore;
            _StddevScore = sourceClassNormalisation._StddevScore;
            _LeftMeanScore = sourceClassNormalisation._LeftMeanScore;
            _RightMeanScore = sourceClassNormalisation._RightMeanScore;
            _WghtMeanScore = sourceClassNormalisation._WghtMeanScore;
            _WghtStddevScore = sourceClassNormalisation._WghtStddevScore;
            _WghtLeftMeanScore = sourceClassNormalisation._WghtLeftMeanScore;
            _WghtRightMeanScore = sourceClassNormalisation._WghtRightMeanScore;
            
        }
    }


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

            _Level.copyFrom (sourceClassNormalisation._Level, 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 BaseClassNormalisation)
        {
            BaseClassNormalisation sourceClassNormalisation = (BaseClassNormalisation)(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);

        _FactorClass = (FactorClass)(HELPER_FactorClass.readExternal (_FactorClass, vals.get(FIELD_FactorClass))); //
        _MeanScore = (Double)(HELPER_MeanScore.readExternal (_MeanScore, vals.get(FIELD_MeanScore))); //
        _MaxScore = (Double)(HELPER_MaxScore.readExternal (_MaxScore, vals.get(FIELD_MaxScore))); //
        _MinScore = (Double)(HELPER_MinScore.readExternal (_MinScore, vals.get(FIELD_MinScore))); //
        _StddevScore = (Double)(HELPER_StddevScore.readExternal (_StddevScore, vals.get(FIELD_StddevScore))); //
        _LeftMeanScore = (Double)(HELPER_LeftMeanScore.readExternal (_LeftMeanScore, vals.get(FIELD_LeftMeanScore))); //
        _RightMeanScore = (Double)(HELPER_RightMeanScore.readExternal (_RightMeanScore, vals.get(FIELD_RightMeanScore))); //
        _WghtMeanScore = (Double)(HELPER_WghtMeanScore.readExternal (_WghtMeanScore, vals.get(FIELD_WghtMeanScore))); //
        _WghtStddevScore = (Double)(HELPER_WghtStddevScore.readExternal (_WghtStddevScore, vals.get(FIELD_WghtStddevScore))); //
        _WghtLeftMeanScore = (Double)(HELPER_WghtLeftMeanScore.readExternal (_WghtLeftMeanScore, vals.get(FIELD_WghtLeftMeanScore))); //
        _WghtRightMeanScore = (Double)(HELPER_WghtRightMeanScore.readExternal (_WghtRightMeanScore, vals.get(FIELD_WghtRightMeanScore))); //
        _Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
        
    }


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

        vals.put (FIELD_FactorClass, HELPER_FactorClass.writeExternal (_FactorClass));
        vals.put (FIELD_MeanScore, HELPER_MeanScore.writeExternal (_MeanScore));
        vals.put (FIELD_MaxScore, HELPER_MaxScore.writeExternal (_MaxScore));
        vals.put (FIELD_MinScore, HELPER_MinScore.writeExternal (_MinScore));
        vals.put (FIELD_StddevScore, HELPER_StddevScore.writeExternal (_StddevScore));
        vals.put (FIELD_LeftMeanScore, HELPER_LeftMeanScore.writeExternal (_LeftMeanScore));
        vals.put (FIELD_RightMeanScore, HELPER_RightMeanScore.writeExternal (_RightMeanScore));
        vals.put (FIELD_WghtMeanScore, HELPER_WghtMeanScore.writeExternal (_WghtMeanScore));
        vals.put (FIELD_WghtStddevScore, HELPER_WghtStddevScore.writeExternal (_WghtStddevScore));
        vals.put (FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.writeExternal (_WghtLeftMeanScore));
        vals.put (FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.writeExternal (_WghtRightMeanScore));
        vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
        
    }


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

        if (other instanceof BaseClassNormalisation)
        {
            BaseClassNormalisation otherClassNormalisation = (BaseClassNormalisation)(other);

            
            if (!HELPER_FactorClass.compare(this._FactorClass, otherClassNormalisation._FactorClass))
            {
                listener.notifyFieldChange(this, other, FIELD_FactorClass, HELPER_FactorClass.toObject(this._FactorClass), HELPER_FactorClass.toObject(otherClassNormalisation._FactorClass));
            }
            if (!HELPER_MeanScore.compare(this._MeanScore, otherClassNormalisation._MeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MeanScore, HELPER_MeanScore.toObject(this._MeanScore), HELPER_MeanScore.toObject(otherClassNormalisation._MeanScore));
            }
            if (!HELPER_MaxScore.compare(this._MaxScore, otherClassNormalisation._MaxScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MaxScore, HELPER_MaxScore.toObject(this._MaxScore), HELPER_MaxScore.toObject(otherClassNormalisation._MaxScore));
            }
            if (!HELPER_MinScore.compare(this._MinScore, otherClassNormalisation._MinScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MinScore, HELPER_MinScore.toObject(this._MinScore), HELPER_MinScore.toObject(otherClassNormalisation._MinScore));
            }
            if (!HELPER_StddevScore.compare(this._StddevScore, otherClassNormalisation._StddevScore))
            {
                listener.notifyFieldChange(this, other, FIELD_StddevScore, HELPER_StddevScore.toObject(this._StddevScore), HELPER_StddevScore.toObject(otherClassNormalisation._StddevScore));
            }
            if (!HELPER_LeftMeanScore.compare(this._LeftMeanScore, otherClassNormalisation._LeftMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_LeftMeanScore, HELPER_LeftMeanScore.toObject(this._LeftMeanScore), HELPER_LeftMeanScore.toObject(otherClassNormalisation._LeftMeanScore));
            }
            if (!HELPER_RightMeanScore.compare(this._RightMeanScore, otherClassNormalisation._RightMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_RightMeanScore, HELPER_RightMeanScore.toObject(this._RightMeanScore), HELPER_RightMeanScore.toObject(otherClassNormalisation._RightMeanScore));
            }
            if (!HELPER_WghtMeanScore.compare(this._WghtMeanScore, otherClassNormalisation._WghtMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtMeanScore, HELPER_WghtMeanScore.toObject(this._WghtMeanScore), HELPER_WghtMeanScore.toObject(otherClassNormalisation._WghtMeanScore));
            }
            if (!HELPER_WghtStddevScore.compare(this._WghtStddevScore, otherClassNormalisation._WghtStddevScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtStddevScore, HELPER_WghtStddevScore.toObject(this._WghtStddevScore), HELPER_WghtStddevScore.toObject(otherClassNormalisation._WghtStddevScore));
            }
            if (!HELPER_WghtLeftMeanScore.compare(this._WghtLeftMeanScore, otherClassNormalisation._WghtLeftMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.toObject(this._WghtLeftMeanScore), HELPER_WghtLeftMeanScore.toObject(otherClassNormalisation._WghtLeftMeanScore));
            }
            if (!HELPER_WghtRightMeanScore.compare(this._WghtRightMeanScore, otherClassNormalisation._WghtRightMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.toObject(this._WghtRightMeanScore), HELPER_WghtRightMeanScore.toObject(otherClassNormalisation._WghtRightMeanScore));
            }

            // Compare single assocs
            _Level.compare (otherClassNormalisation._Level, 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_FactorClass, HELPER_FactorClass.toObject(getFactorClass()));
        visitor.visitField(this, FIELD_MeanScore, HELPER_MeanScore.toObject(getMeanScore()));
        visitor.visitField(this, FIELD_MaxScore, HELPER_MaxScore.toObject(getMaxScore()));
        visitor.visitField(this, FIELD_MinScore, HELPER_MinScore.toObject(getMinScore()));
        visitor.visitField(this, FIELD_StddevScore, HELPER_StddevScore.toObject(getStddevScore()));
        visitor.visitField(this, FIELD_LeftMeanScore, HELPER_LeftMeanScore.toObject(getLeftMeanScore()));
        visitor.visitField(this, FIELD_RightMeanScore, HELPER_RightMeanScore.toObject(getRightMeanScore()));
        visitor.visitField(this, FIELD_WghtMeanScore, HELPER_WghtMeanScore.toObject(getWghtMeanScore()));
        visitor.visitField(this, FIELD_WghtStddevScore, HELPER_WghtStddevScore.toObject(getWghtStddevScore()));
        visitor.visitField(this, FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.toObject(getWghtLeftMeanScore()));
        visitor.visitField(this, FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.toObject(getWghtRightMeanScore()));
        visitor.visitAssociation (_Level);
        
    }


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

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


    public static ClassNormalisation createClassNormalisation (ObjectTransaction transaction) throws StorageException
    {
        ClassNormalisation     result = new ClassNormalisation ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static ClassNormalisation getClassNormalisationByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (ClassNormalisation)(transaction.getObjectByID (REFERENCE_ClassNormalisation, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FactorClass))
        {
            return filter.matches (getFactorClass ());
        }
        else if (attribName.equals (FIELD_MeanScore))
        {
            return filter.matches (getMeanScore ());
        }
        else if (attribName.equals (FIELD_MaxScore))
        {
            return filter.matches (getMaxScore ());
        }
        else if (attribName.equals (FIELD_MinScore))
        {
            return filter.matches (getMinScore ());
        }
        else if (attribName.equals (FIELD_StddevScore))
        {
            return filter.matches (getStddevScore ());
        }
        else if (attribName.equals (FIELD_LeftMeanScore))
        {
            return filter.matches (getLeftMeanScore ());
        }
        else if (attribName.equals (FIELD_RightMeanScore))
        {
            return filter.matches (getRightMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtMeanScore))
        {
            return filter.matches (getWghtMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtStddevScore))
        {
            return filter.matches (getWghtStddevScore ());
        }
        else if (attribName.equals (FIELD_WghtLeftMeanScore))
        {
            return filter.matches (getWghtLeftMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtRightMeanScore))
        {
            return filter.matches (getWghtRightMeanScore ());
        }
        else if (attribName.equals (SINGLEREFERENCE_Level))
        {
            return filter.matches (getLevel ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }


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

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

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

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

            
            public SearchAll andFactorClass (QueryFilter<FactorClass> filter)
            {
                filter.addFilter (context, "tl_class_norm.class_code", "FactorClass");
                return this;
            }
            
            public SearchAll andMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.mean_score", "MeanScore");
                return this;
            }
            
            public SearchAll andMaxScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.max_score", "MaxScore");
                return this;
            }
            
            public SearchAll andMinScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.min_score", "MinScore");
                return this;
            }
            
            public SearchAll andStddevScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.stddev_score", "StddevScore");
                return this;
            }
            
            public SearchAll andLeftMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.left_mean_score", "LeftMeanScore");
                return this;
            }
            
            public SearchAll andRightMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.right_mean_score", "RightMeanScore");
                return this;
            }
            
            public SearchAll andWghtMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.wght_mean_score", "WghtMeanScore");
                return this;
            }
            
            public SearchAll andWghtStddevScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.wght_stddev_score", "WghtStddevScore");
                return this;
            }
            
            public SearchAll andWghtLeftMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.wght_left_mean_score", "WghtLeftMeanScore");
                return this;
            }
            
            public SearchAll andWghtRightMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_class_norm.wght_right_mean_score", "WghtRightMeanScore");
                return this;
            }
            
            public SearchAll andLevel (QueryFilter<Level> filter)
            {
                filter.addFilter (context, "tl_class_norm.level_number", "Level");
                return this;
            }
            
                public ClassNormalisation[]
             search (ObjectTransaction transaction) throws StorageException
        {
            
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_ClassNormalisation, SEARCH_All, criteria);
            Set<ClassNormalisation>   typedResults = new LinkedHashSet <ClassNormalisation> ();
            for (BaseBusinessClass bbcResult : results)
            {
                ClassNormalisation aResult = (ClassNormalisation)bbcResult;
                
                typedResults.add (aResult);
            }
            
                    return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ClassNormalisation[0]);
                            
        }
    }

        
                public static ClassNormalisation[]
             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_FactorClass))
        {
            return HELPER_FactorClass.toObject (getFactorClass ());
        }
        else if (attribName.equals (FIELD_MeanScore))
        {
            return HELPER_MeanScore.toObject (getMeanScore ());
        }
        else if (attribName.equals (FIELD_MaxScore))
        {
            return HELPER_MaxScore.toObject (getMaxScore ());
        }
        else if (attribName.equals (FIELD_MinScore))
        {
            return HELPER_MinScore.toObject (getMinScore ());
        }
        else if (attribName.equals (FIELD_StddevScore))
        {
            return HELPER_StddevScore.toObject (getStddevScore ());
        }
        else if (attribName.equals (FIELD_LeftMeanScore))
        {
            return HELPER_LeftMeanScore.toObject (getLeftMeanScore ());
        }
        else if (attribName.equals (FIELD_RightMeanScore))
        {
            return HELPER_RightMeanScore.toObject (getRightMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtMeanScore))
        {
            return HELPER_WghtMeanScore.toObject (getWghtMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtStddevScore))
        {
            return HELPER_WghtStddevScore.toObject (getWghtStddevScore ());
        }
        else if (attribName.equals (FIELD_WghtLeftMeanScore))
        {
            return HELPER_WghtLeftMeanScore.toObject (getWghtLeftMeanScore ());
        }
        else if (attribName.equals (FIELD_WghtRightMeanScore))
        {
            return HELPER_WghtRightMeanScore.toObject (getWghtRightMeanScore ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_FactorClass))
        {
            return HELPER_FactorClass;
        }
        else if (attribName.equals (FIELD_MeanScore))
        {
            return HELPER_MeanScore;
        }
        else if (attribName.equals (FIELD_MaxScore))
        {
            return HELPER_MaxScore;
        }
        else if (attribName.equals (FIELD_MinScore))
        {
            return HELPER_MinScore;
        }
        else if (attribName.equals (FIELD_StddevScore))
        {
            return HELPER_StddevScore;
        }
        else if (attribName.equals (FIELD_LeftMeanScore))
        {
            return HELPER_LeftMeanScore;
        }
        else if (attribName.equals (FIELD_RightMeanScore))
        {
            return HELPER_RightMeanScore;
        }
        else if (attribName.equals (FIELD_WghtMeanScore))
        {
            return HELPER_WghtMeanScore;
        }
        else if (attribName.equals (FIELD_WghtStddevScore))
        {
            return HELPER_WghtStddevScore;
        }
        else if (attribName.equals (FIELD_WghtLeftMeanScore))
        {
            return HELPER_WghtLeftMeanScore;
        }
        else if (attribName.equals (FIELD_WghtRightMeanScore))
        {
            return HELPER_WghtRightMeanScore;
        }
        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_FactorClass))
        {
            setFactorClass ((FactorClass)(HELPER_FactorClass.fromObject (_FactorClass, attribValue)));            
        }
        else if (attribName.equals (FIELD_MeanScore))
        {
            setMeanScore ((Double)(HELPER_MeanScore.fromObject (_MeanScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_MaxScore))
        {
            setMaxScore ((Double)(HELPER_MaxScore.fromObject (_MaxScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_MinScore))
        {
            setMinScore ((Double)(HELPER_MinScore.fromObject (_MinScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_StddevScore))
        {
            setStddevScore ((Double)(HELPER_StddevScore.fromObject (_StddevScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_LeftMeanScore))
        {
            setLeftMeanScore ((Double)(HELPER_LeftMeanScore.fromObject (_LeftMeanScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_RightMeanScore))
        {
            setRightMeanScore ((Double)(HELPER_RightMeanScore.fromObject (_RightMeanScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_WghtMeanScore))
        {
            setWghtMeanScore ((Double)(HELPER_WghtMeanScore.fromObject (_WghtMeanScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_WghtStddevScore))
        {
            setWghtStddevScore ((Double)(HELPER_WghtStddevScore.fromObject (_WghtStddevScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_WghtLeftMeanScore))
        {
            setWghtLeftMeanScore ((Double)(HELPER_WghtLeftMeanScore.fromObject (_WghtLeftMeanScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_WghtRightMeanScore))
        {
            setWghtRightMeanScore ((Double)(HELPER_WghtRightMeanScore.fromObject (_WghtRightMeanScore, 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_FactorClass))
        {
            return getWriteability_FactorClass ();
        }
        else if (fieldName.equals (FIELD_MeanScore))
        {
            return getWriteability_MeanScore ();
        }
        else if (fieldName.equals (FIELD_MaxScore))
        {
            return getWriteability_MaxScore ();
        }
        else if (fieldName.equals (FIELD_MinScore))
        {
            return getWriteability_MinScore ();
        }
        else if (fieldName.equals (FIELD_StddevScore))
        {
            return getWriteability_StddevScore ();
        }
        else if (fieldName.equals (FIELD_LeftMeanScore))
        {
            return getWriteability_LeftMeanScore ();
        }
        else if (fieldName.equals (FIELD_RightMeanScore))
        {
            return getWriteability_RightMeanScore ();
        }
        else if (fieldName.equals (FIELD_WghtMeanScore))
        {
            return getWriteability_WghtMeanScore ();
        }
        else if (fieldName.equals (FIELD_WghtStddevScore))
        {
            return getWriteability_WghtStddevScore ();
        }
        else if (fieldName.equals (FIELD_WghtLeftMeanScore))
        {
            return getWriteability_WghtLeftMeanScore ();
        }
        else if (fieldName.equals (FIELD_WghtRightMeanScore))
        {
            return getWriteability_WghtRightMeanScore ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Level))
        {
            return getWriteability_Level ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        
            if (getWriteability_FactorClass () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_FactorClass);
            }
        
            if (getWriteability_MeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MeanScore);
            }
        
            if (getWriteability_MaxScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MaxScore);
            }
        
            if (getWriteability_MinScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MinScore);
            }
        
            if (getWriteability_StddevScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_StddevScore);
            }
        
            if (getWriteability_LeftMeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_LeftMeanScore);
            }
        
            if (getWriteability_RightMeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_RightMeanScore);
            }
        
            if (getWriteability_WghtMeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_WghtMeanScore);
            }
        
            if (getWriteability_WghtStddevScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_WghtStddevScore);
            }
        
            if (getWriteability_WghtLeftMeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_WghtLeftMeanScore);
            }
        
            if (getWriteability_WghtRightMeanScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_WghtRightMeanScore);
            }
        

        super.putUnwriteable (fields);
    }

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

        
        result.add(HELPER_FactorClass.getAttribObject (getClass (), _FactorClass, false, FIELD_FactorClass));
        result.add(HELPER_MeanScore.getAttribObject (getClass (), _MeanScore, false, FIELD_MeanScore));
        result.add(HELPER_MaxScore.getAttribObject (getClass (), _MaxScore, false, FIELD_MaxScore));
        result.add(HELPER_MinScore.getAttribObject (getClass (), _MinScore, false, FIELD_MinScore));
        result.add(HELPER_StddevScore.getAttribObject (getClass (), _StddevScore, false, FIELD_StddevScore));
        result.add(HELPER_LeftMeanScore.getAttribObject (getClass (), _LeftMeanScore, false, FIELD_LeftMeanScore));
        result.add(HELPER_RightMeanScore.getAttribObject (getClass (), _RightMeanScore, false, FIELD_RightMeanScore));
        result.add(HELPER_WghtMeanScore.getAttribObject (getClass (), _WghtMeanScore, false, FIELD_WghtMeanScore));
        result.add(HELPER_WghtStddevScore.getAttribObject (getClass (), _WghtStddevScore, false, FIELD_WghtStddevScore));
        result.add(HELPER_WghtLeftMeanScore.getAttribObject (getClass (), _WghtLeftMeanScore, false, FIELD_WghtLeftMeanScore));
        result.add(HELPER_WghtRightMeanScore.getAttribObject (getClass (), _WghtRightMeanScore, false, FIELD_WghtRightMeanScore));

        return result;
    }


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


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

    /**
     * Get the attribute FactorClass
     */
    public FactorClass getFactorClass (ClassNormalisation obj, FactorClass original)
    {
        return original;
    }

    /**
     * Change the value set for attribute FactorClass.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public FactorClass setFactorClass (ClassNormalisation obj, FactorClass newFactorClass) throws FieldException
    {
        return newFactorClass;
    }

    /**
     * Get the attribute MeanScore
     */
    public Double getMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setMeanScore (ClassNormalisation obj, Double newMeanScore) throws FieldException
    {
        return newMeanScore;
    }

    /**
     * Get the attribute MaxScore
     */
    public Double getMaxScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MaxScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setMaxScore (ClassNormalisation obj, Double newMaxScore) throws FieldException
    {
        return newMaxScore;
    }

    /**
     * Get the attribute MinScore
     */
    public Double getMinScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MinScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setMinScore (ClassNormalisation obj, Double newMinScore) throws FieldException
    {
        return newMinScore;
    }

    /**
     * Get the attribute StddevScore
     */
    public Double getStddevScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute StddevScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setStddevScore (ClassNormalisation obj, Double newStddevScore) throws FieldException
    {
        return newStddevScore;
    }

    /**
     * Get the attribute LeftMeanScore
     */
    public Double getLeftMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute LeftMeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setLeftMeanScore (ClassNormalisation obj, Double newLeftMeanScore) throws FieldException
    {
        return newLeftMeanScore;
    }

    /**
     * Get the attribute RightMeanScore
     */
    public Double getRightMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute RightMeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setRightMeanScore (ClassNormalisation obj, Double newRightMeanScore) throws FieldException
    {
        return newRightMeanScore;
    }

    /**
     * Get the attribute WghtMeanScore
     */
    public Double getWghtMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute WghtMeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setWghtMeanScore (ClassNormalisation obj, Double newWghtMeanScore) throws FieldException
    {
        return newWghtMeanScore;
    }

    /**
     * Get the attribute WghtStddevScore
     */
    public Double getWghtStddevScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute WghtStddevScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setWghtStddevScore (ClassNormalisation obj, Double newWghtStddevScore) throws FieldException
    {
        return newWghtStddevScore;
    }

    /**
     * Get the attribute WghtLeftMeanScore
     */
    public Double getWghtLeftMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute WghtLeftMeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setWghtLeftMeanScore (ClassNormalisation obj, Double newWghtLeftMeanScore) throws FieldException
    {
        return newWghtLeftMeanScore;
    }

    /**
     * Get the attribute WghtRightMeanScore
     */
    public Double getWghtRightMeanScore (ClassNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute WghtRightMeanScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setWghtRightMeanScore (ClassNormalisation obj, Double newWghtRightMeanScore) throws FieldException
    {
        return newWghtRightMeanScore;
    }

    }

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

        public ClassNormalisationPipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("FactorClass"))
            {
                return toFactorClass ();
            }                
            if (name.equals ("MeanScore"))
            {
                return toMeanScore ();
            }                
            if (name.equals ("MaxScore"))
            {
                return toMaxScore ();
            }                
            if (name.equals ("MinScore"))
            {
                return toMinScore ();
            }                
            if (name.equals ("StddevScore"))
            {
                return toStddevScore ();
            }                
            if (name.equals ("LeftMeanScore"))
            {
                return toLeftMeanScore ();
            }                
            if (name.equals ("RightMeanScore"))
            {
                return toRightMeanScore ();
            }                
            if (name.equals ("WghtMeanScore"))
            {
                return toWghtMeanScore ();
            }                
            if (name.equals ("WghtStddevScore"))
            {
                return toWghtStddevScore ();
            }                
            if (name.equals ("WghtLeftMeanScore"))
            {
                return toWghtLeftMeanScore ();
            }                
            if (name.equals ("WghtRightMeanScore"))
            {
                return toWghtRightMeanScore ();
            }                
            if (name.equals ("Level"))
            {
                return toLevel ();
            }                
            
            
            return super.to(name);
        }
        
        
        public PipeLine<From, FactorClass> toFactorClass () { return pipe(new ORMAttributePipe<Me, FactorClass>(FIELD_FactorClass));  }
        
        public PipeLine<From, Double> toMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_MeanScore));  }
        
        public PipeLine<From, Double> toMaxScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_MaxScore));  }
        
        public PipeLine<From, Double> toMinScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_MinScore));  }
        
        public PipeLine<From, Double> toStddevScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_StddevScore));  }
        
        public PipeLine<From, Double> toLeftMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_LeftMeanScore));  }
        
        public PipeLine<From, Double> toRightMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_RightMeanScore));  }
        
        public PipeLine<From, Double> toWghtMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_WghtMeanScore));  }
        
        public PipeLine<From, Double> toWghtStddevScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_WghtStddevScore));  }
        
        public PipeLine<From, Double> toWghtLeftMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_WghtLeftMeanScore));  }
        
        public PipeLine<From, Double> toWghtRightMeanScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_WghtRightMeanScore));  }
        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 boolean isTransientAttrib(String attribName)
    {
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

class DummyClassNormalisation extends ClassNormalisation
{
    // Default constructor primarily to support Externalisable
    public DummyClassNormalisation()
    {
        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();
    }

}

    
