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

    // Reference instance for the object
    public static final LevelNormalisation DUMMY_LevelNormalisation = new DummyLevelNormalisation ();

    // Static constants corresponding to field names
    
    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 FIELD_MeanWghtZScore = "MeanWghtZScore";
    public static final String FIELD_MeanWghtZScores = "MeanWghtZScores";
    public static final String FIELD_StdDevWghtZScore = "StdDevWghtZScore";
    public static final String FIELD_StdDevWghtZScore2 = "StdDevWghtZScore2";
    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 DefaultAttributeHelper<LevelNormalisation> HELPER_MeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_MaxScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_MinScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_StddevScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_LeftMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_RightMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_WghtMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_WghtStddevScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_WghtLeftMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_WghtRightMeanScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_MeanWghtZScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_MeanWghtZScores = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_StdDevWghtZScore = DefaultAttributeHelper.INSTANCE;
    private static final DefaultAttributeHelper<LevelNormalisation> HELPER_StdDevWghtZScore2 = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    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 Double _MeanWghtZScore;
    private Double _MeanWghtZScores;
    private Double _StdDevWghtZScore;
    private Double _StdDevWghtZScore2;
    

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

    // Private attributes corresponding to multiple references
    

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

    // Arrays of validators for each attribute
    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;
    private static final AttributeValidator[] FIELD_MeanWghtZScore_Validators;
    private static final AttributeValidator[] FIELD_MeanWghtZScores_Validators;
    private static final AttributeValidator[] FIELD_StdDevWghtZScore_Validators;
    private static final AttributeValidator[] FIELD_StdDevWghtZScore2_Validators;
    

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

            setupAssocMetaData_Level();
            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]);
            FIELD_MeanWghtZScore_Validators = (AttributeValidator[])setupAttribMetaData_MeanWghtZScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_MeanWghtZScores_Validators = (AttributeValidator[])setupAttribMetaData_MeanWghtZScores(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_StdDevWghtZScore_Validators = (AttributeValidator[])setupAttribMetaData_StdDevWghtZScore(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_StdDevWghtZScore2_Validators = (AttributeValidator[])setupAttribMetaData_StdDevWghtZScore2(validatorMapping).toArray (new AttributeValidator[0]);
            

            REFERENCE_LevelNormalisation.initialiseReference ();
            DUMMY_LevelNormalisation.initialiseReference ();
            LevelNormalisation_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(LevelNormalisation.class).toArray(new LevelNormalisationBehaviourDecorator[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", "LevelNormalisations");
        metaInfo.put ("dbcol", "level_number");
        metaInfo.put ("name", "Level");
        metaInfo.put ("type", "Level");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for LevelNormalisation.Level:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (SINGLEREFERENCE_Level, Collections.unmodifiableMap (metaInfo));
    }
    
    
    // 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 LevelNormalisation.MeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_MeanScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "MeanScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.MaxScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_MaxScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "MaxScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.MinScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_MinScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "MinScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.StddevScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_StddevScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "StddevScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.LeftMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_LeftMeanScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "LeftMeanScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.RightMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_RightMeanScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "RightMeanScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.WghtMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_WghtMeanScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "WghtMeanScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.WghtStddevScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_WghtStddevScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "WghtStddevScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.WghtLeftMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_WghtLeftMeanScore, Collections.unmodifiableMap (metaInfo));

        List validators = BaseBusinessClass.getAttribValidators(LevelNormalisation.class, "WghtLeftMeanScore", metaInfo, validatorMapping);
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for LevelNormalisation.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 LevelNormalisation.WghtRightMeanScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_WghtRightMeanScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "mean_wght_z_score");
        metaInfo.put ("name", "MeanWghtZScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for LevelNormalisation.MeanWghtZScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_MeanWghtZScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "mean_wght_z_score_2");
        metaInfo.put ("name", "MeanWghtZScores");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for LevelNormalisation.MeanWghtZScores:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_MeanWghtZScores, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "stddev_wght_z_score");
        metaInfo.put ("name", "StdDevWghtZScore");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for LevelNormalisation.StdDevWghtZScore:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_StdDevWghtZScore, Collections.unmodifiableMap (metaInfo));

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

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

        metaInfo.put ("dbcol", "stddev_wght_z_score_2");
        metaInfo.put ("name", "StdDevWghtZScore2");
        metaInfo.put ("type", "Double");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for LevelNormalisation.StdDevWghtZScore2:", metaInfo);
        ATTRIBUTES_METADATA_LevelNormalisation.put (FIELD_StdDevWghtZScore2, Collections.unmodifiableMap (metaInfo));

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

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


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


    


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

        
        _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));
        _MeanWghtZScore = (Double)(HELPER_MeanWghtZScore.initialise (_MeanWghtZScore));
        _MeanWghtZScores = (Double)(HELPER_MeanWghtZScores.initialise (_MeanWghtZScores));
        _StdDevWghtZScore = (Double)(HELPER_StdDevWghtZScore.initialise (_StdDevWghtZScore));
        _StdDevWghtZScore2 = (Double)(HELPER_StdDevWghtZScore2.initialise (_StdDevWghtZScore2));
    }


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

        _Level = new SingleAssociation<LevelNormalisation, Level> (this, SINGLEREFERENCE_Level, Level.MULTIPLEREFERENCE_LevelNormalisations, Level.REFERENCE_Level, "tl_level_norm");
        
    }


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

    

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

            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newMeanScore = bhd.setMeanScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMaxScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newMaxScore = bhd.setMaxScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMinScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newMinScore = bhd.setMinScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getStddevScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newStddevScore = bhd.setStddevScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getLeftMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newLeftMeanScore = bhd.setLeftMeanScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getRightMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newRightMeanScore = bhd.setRightMeanScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newWghtMeanScore = bhd.setWghtMeanScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtStddevScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newWghtStddevScore = bhd.setWghtStddevScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtLeftMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newWghtLeftMeanScore = bhd.setWghtLeftMeanScore ((LevelNormalisation)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_LevelNormalisation.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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getWghtRightMeanScore ((LevelNormalisation)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 (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newWghtRightMeanScore = bhd.setWghtRightMeanScore ((LevelNormalisation)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_LevelNormalisation.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 ();
        }
    }

    /**
     * Get the attribute MeanWghtZScore
     */
    public Double getMeanWghtZScore ()
    {
        assertValid();
        Double valToReturn = _MeanWghtZScore;

            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMeanWghtZScore ((LevelNormalisation)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 preMeanWghtZScoreChange (Double newMeanWghtZScore) 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 postMeanWghtZScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MeanWghtZScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMeanWghtZScore (Double newMeanWghtZScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MeanWghtZScore.compare (_MeanWghtZScore, newMeanWghtZScore);
        
        try
        {
            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newMeanWghtZScore = bhd.setMeanWghtZScore ((LevelNormalisation)this, newMeanWghtZScore);
                oldAndNewIdentical = HELPER_MeanWghtZScore.compare (_MeanWghtZScore, newMeanWghtZScore);
            }

            

            if (FIELD_MeanWghtZScore_Validators.length > 0)
            {
                Object newMeanWghtZScoreObj = HELPER_MeanWghtZScore.toObject (newMeanWghtZScore);

                if (newMeanWghtZScoreObj != null)
                {
                    int     loopMax = FIELD_MeanWghtZScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_LevelNormalisation.get (FIELD_MeanWghtZScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MeanWghtZScore () != FieldWriteability.FALSE, "Field  MeanWghtZScore is not writeable");
            preMeanWghtZScoreChange (newMeanWghtZScore);
            markFieldChange (FIELD_MeanWghtZScore);
            _MeanWghtZScore = newMeanWghtZScore;            
            postFieldChange (FIELD_MeanWghtZScore);
            postMeanWghtZScoreChange ();
        }
    }

    /**
     * Get the attribute MeanWghtZScores
     */
    public Double getMeanWghtZScores ()
    {
        assertValid();
        Double valToReturn = _MeanWghtZScores;

            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getMeanWghtZScores ((LevelNormalisation)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 preMeanWghtZScoresChange (Double newMeanWghtZScores) 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 postMeanWghtZScoresChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute MeanWghtZScores.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setMeanWghtZScores (Double newMeanWghtZScores) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_MeanWghtZScores.compare (_MeanWghtZScores, newMeanWghtZScores);
        
        try
        {
            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newMeanWghtZScores = bhd.setMeanWghtZScores ((LevelNormalisation)this, newMeanWghtZScores);
                oldAndNewIdentical = HELPER_MeanWghtZScores.compare (_MeanWghtZScores, newMeanWghtZScores);
            }

            

            if (FIELD_MeanWghtZScores_Validators.length > 0)
            {
                Object newMeanWghtZScoresObj = HELPER_MeanWghtZScores.toObject (newMeanWghtZScores);

                if (newMeanWghtZScoresObj != null)
                {
                    int     loopMax = FIELD_MeanWghtZScores_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_LevelNormalisation.get (FIELD_MeanWghtZScores);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_MeanWghtZScores () != FieldWriteability.FALSE, "Field  MeanWghtZScores is not writeable");
            preMeanWghtZScoresChange (newMeanWghtZScores);
            markFieldChange (FIELD_MeanWghtZScores);
            _MeanWghtZScores = newMeanWghtZScores;            
            postFieldChange (FIELD_MeanWghtZScores);
            postMeanWghtZScoresChange ();
        }
    }

    /**
     * Get the attribute StdDevWghtZScore
     */
    public Double getStdDevWghtZScore ()
    {
        assertValid();
        Double valToReturn = _StdDevWghtZScore;

            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getStdDevWghtZScore ((LevelNormalisation)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 preStdDevWghtZScoreChange (Double newStdDevWghtZScore) 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 postStdDevWghtZScoreChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute StdDevWghtZScore.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setStdDevWghtZScore (Double newStdDevWghtZScore) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_StdDevWghtZScore.compare (_StdDevWghtZScore, newStdDevWghtZScore);
        
        try
        {
            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newStdDevWghtZScore = bhd.setStdDevWghtZScore ((LevelNormalisation)this, newStdDevWghtZScore);
                oldAndNewIdentical = HELPER_StdDevWghtZScore.compare (_StdDevWghtZScore, newStdDevWghtZScore);
            }

            

            if (FIELD_StdDevWghtZScore_Validators.length > 0)
            {
                Object newStdDevWghtZScoreObj = HELPER_StdDevWghtZScore.toObject (newStdDevWghtZScore);

                if (newStdDevWghtZScoreObj != null)
                {
                    int     loopMax = FIELD_StdDevWghtZScore_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_LevelNormalisation.get (FIELD_StdDevWghtZScore);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_StdDevWghtZScore () != FieldWriteability.FALSE, "Field  StdDevWghtZScore is not writeable");
            preStdDevWghtZScoreChange (newStdDevWghtZScore);
            markFieldChange (FIELD_StdDevWghtZScore);
            _StdDevWghtZScore = newStdDevWghtZScore;            
            postFieldChange (FIELD_StdDevWghtZScore);
            postStdDevWghtZScoreChange ();
        }
    }

    /**
     * Get the attribute StdDevWghtZScore2
     */
    public Double getStdDevWghtZScore2 ()
    {
        assertValid();
        Double valToReturn = _StdDevWghtZScore2;

            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                valToReturn = bhd.getStdDevWghtZScore2 ((LevelNormalisation)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 preStdDevWghtZScore2Change (Double newStdDevWghtZScore2) 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 postStdDevWghtZScore2Change () throws FieldException
    {
    }

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

    /**
     * Set the attribute StdDevWghtZScore2.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setStdDevWghtZScore2 (Double newStdDevWghtZScore2) throws FieldException
    {
        boolean oldAndNewIdentical = HELPER_StdDevWghtZScore2.compare (_StdDevWghtZScore2, newStdDevWghtZScore2);
        
        try
        {
            for (LevelNormalisationBehaviourDecorator bhd : LevelNormalisation_BehaviourDecorators)
            {
                newStdDevWghtZScore2 = bhd.setStdDevWghtZScore2 ((LevelNormalisation)this, newStdDevWghtZScore2);
                oldAndNewIdentical = HELPER_StdDevWghtZScore2.compare (_StdDevWghtZScore2, newStdDevWghtZScore2);
            }

            

            if (FIELD_StdDevWghtZScore2_Validators.length > 0)
            {
                Object newStdDevWghtZScore2Obj = HELPER_StdDevWghtZScore2.toObject (newStdDevWghtZScore2);

                if (newStdDevWghtZScore2Obj != null)
                {
                    int     loopMax = FIELD_StdDevWghtZScore2_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_LevelNormalisation.get (FIELD_StdDevWghtZScore2);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (getWriteability_StdDevWghtZScore2 () != FieldWriteability.FALSE, "Field  StdDevWghtZScore2 is not writeable");
            preStdDevWghtZScore2Change (newStdDevWghtZScore2);
            markFieldChange (FIELD_StdDevWghtZScore2);
            _StdDevWghtZScore2 = newStdDevWghtZScore2;            
            postFieldChange (FIELD_StdDevWghtZScore2);
            postStdDevWghtZScore2Change ();
        }
    }



    /**
     * 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_LevelNormalisations ;
        }
        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 LevelNormalisation:", 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.removeFromLevelNormalisations ((LevelNormalisation)(this));
                    }

                    _Level.set (newLevel);

                    if (newLevel != null)
                    {
                        newLevel.addToLevelNormalisations ((LevelNormalisation)(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 LevelNormalisations from ", getObjectID (), " to ", referenced.getObjectID ());
                    _Level.set (null);
                    referenced.removeFromLevelNormalisations ((LevelNormalisation)this);
                }
            }
        
        }
        catch (Exception e)
        {
            throw NestedException.wrap(e);
        }

        super.onDelete ();
    }


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


    public LevelNormalisation referenceInstance ()
    {
        return REFERENCE_LevelNormalisation;
    }


    public LevelNormalisation getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getLevelNormalisationByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_LevelNormalisation;
    }


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

        tl_level_normPSet.setAttrib (FIELD_ObjectID, myID);
        tl_level_normPSet.setAttrib (FIELD_MeanScore, HELPER_MeanScore.toObject (_MeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_MaxScore, HELPER_MaxScore.toObject (_MaxScore)); //
        tl_level_normPSet.setAttrib (FIELD_MinScore, HELPER_MinScore.toObject (_MinScore)); //
        tl_level_normPSet.setAttrib (FIELD_StddevScore, HELPER_StddevScore.toObject (_StddevScore)); //
        tl_level_normPSet.setAttrib (FIELD_LeftMeanScore, HELPER_LeftMeanScore.toObject (_LeftMeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_RightMeanScore, HELPER_RightMeanScore.toObject (_RightMeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_WghtMeanScore, HELPER_WghtMeanScore.toObject (_WghtMeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_WghtStddevScore, HELPER_WghtStddevScore.toObject (_WghtStddevScore)); //
        tl_level_normPSet.setAttrib (FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.toObject (_WghtLeftMeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.toObject (_WghtRightMeanScore)); //
        tl_level_normPSet.setAttrib (FIELD_MeanWghtZScore, HELPER_MeanWghtZScore.toObject (_MeanWghtZScore)); //
        tl_level_normPSet.setAttrib (FIELD_MeanWghtZScores, HELPER_MeanWghtZScores.toObject (_MeanWghtZScores)); //
        tl_level_normPSet.setAttrib (FIELD_StdDevWghtZScore, HELPER_StdDevWghtZScore.toObject (_StdDevWghtZScore)); //
        tl_level_normPSet.setAttrib (FIELD_StdDevWghtZScore2, HELPER_StdDevWghtZScore2.toObject (_StdDevWghtZScore2)); //
        _Level.getPersistentSets (allSets);
        
    }


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

        
        PersistentSet   tl_level_normPSet = allSets.getPersistentSet (objectID, "tl_level_norm");

        _MeanScore = (Double)(HELPER_MeanScore.fromObject (_MeanScore, tl_level_normPSet.getAttrib (FIELD_MeanScore))); //
        _MaxScore = (Double)(HELPER_MaxScore.fromObject (_MaxScore, tl_level_normPSet.getAttrib (FIELD_MaxScore))); //
        _MinScore = (Double)(HELPER_MinScore.fromObject (_MinScore, tl_level_normPSet.getAttrib (FIELD_MinScore))); //
        _StddevScore = (Double)(HELPER_StddevScore.fromObject (_StddevScore, tl_level_normPSet.getAttrib (FIELD_StddevScore))); //
        _LeftMeanScore = (Double)(HELPER_LeftMeanScore.fromObject (_LeftMeanScore, tl_level_normPSet.getAttrib (FIELD_LeftMeanScore))); //
        _RightMeanScore = (Double)(HELPER_RightMeanScore.fromObject (_RightMeanScore, tl_level_normPSet.getAttrib (FIELD_RightMeanScore))); //
        _WghtMeanScore = (Double)(HELPER_WghtMeanScore.fromObject (_WghtMeanScore, tl_level_normPSet.getAttrib (FIELD_WghtMeanScore))); //
        _WghtStddevScore = (Double)(HELPER_WghtStddevScore.fromObject (_WghtStddevScore, tl_level_normPSet.getAttrib (FIELD_WghtStddevScore))); //
        _WghtLeftMeanScore = (Double)(HELPER_WghtLeftMeanScore.fromObject (_WghtLeftMeanScore, tl_level_normPSet.getAttrib (FIELD_WghtLeftMeanScore))); //
        _WghtRightMeanScore = (Double)(HELPER_WghtRightMeanScore.fromObject (_WghtRightMeanScore, tl_level_normPSet.getAttrib (FIELD_WghtRightMeanScore))); //
        _MeanWghtZScore = (Double)(HELPER_MeanWghtZScore.fromObject (_MeanWghtZScore, tl_level_normPSet.getAttrib (FIELD_MeanWghtZScore))); //
        _MeanWghtZScores = (Double)(HELPER_MeanWghtZScores.fromObject (_MeanWghtZScores, tl_level_normPSet.getAttrib (FIELD_MeanWghtZScores))); //
        _StdDevWghtZScore = (Double)(HELPER_StdDevWghtZScore.fromObject (_StdDevWghtZScore, tl_level_normPSet.getAttrib (FIELD_StdDevWghtZScore))); //
        _StdDevWghtZScore2 = (Double)(HELPER_StdDevWghtZScore2.fromObject (_StdDevWghtZScore2, tl_level_normPSet.getAttrib (FIELD_StdDevWghtZScore2))); //
        _Level.setFromPersistentSets (objectID, allSets);
        
    }





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

        if (other instanceof LevelNormalisation)
        {
            LevelNormalisation otherLevelNormalisation = (LevelNormalisation)other;
            
            try
            {
                setMeanScore (otherLevelNormalisation.getMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMaxScore (otherLevelNormalisation.getMaxScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMinScore (otherLevelNormalisation.getMinScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setStddevScore (otherLevelNormalisation.getStddevScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setLeftMeanScore (otherLevelNormalisation.getLeftMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setRightMeanScore (otherLevelNormalisation.getRightMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtMeanScore (otherLevelNormalisation.getWghtMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtStddevScore (otherLevelNormalisation.getWghtStddevScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtLeftMeanScore (otherLevelNormalisation.getWghtLeftMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setWghtRightMeanScore (otherLevelNormalisation.getWghtRightMeanScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMeanWghtZScore (otherLevelNormalisation.getMeanWghtZScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setMeanWghtZScores (otherLevelNormalisation.getMeanWghtZScores ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setStdDevWghtZScore (otherLevelNormalisation.getStdDevWghtZScore ());
            }
            catch (FieldException ex)
            {
                e.addException (ex);
            }
            
            try
            {
                setStdDevWghtZScore2 (otherLevelNormalisation.getStdDevWghtZScore2 ());
            }
            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 BaseLevelNormalisation)
        {
            BaseLevelNormalisation sourceLevelNormalisation = (BaseLevelNormalisation)(source);

            _MeanScore = sourceLevelNormalisation._MeanScore;
            _MaxScore = sourceLevelNormalisation._MaxScore;
            _MinScore = sourceLevelNormalisation._MinScore;
            _StddevScore = sourceLevelNormalisation._StddevScore;
            _LeftMeanScore = sourceLevelNormalisation._LeftMeanScore;
            _RightMeanScore = sourceLevelNormalisation._RightMeanScore;
            _WghtMeanScore = sourceLevelNormalisation._WghtMeanScore;
            _WghtStddevScore = sourceLevelNormalisation._WghtStddevScore;
            _WghtLeftMeanScore = sourceLevelNormalisation._WghtLeftMeanScore;
            _WghtRightMeanScore = sourceLevelNormalisation._WghtRightMeanScore;
            _MeanWghtZScore = sourceLevelNormalisation._MeanWghtZScore;
            _MeanWghtZScores = sourceLevelNormalisation._MeanWghtZScores;
            _StdDevWghtZScore = sourceLevelNormalisation._StdDevWghtZScore;
            _StdDevWghtZScore2 = sourceLevelNormalisation._StdDevWghtZScore2;
            
        }
    }


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

            _Level.copyFrom (sourceLevelNormalisation._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 BaseLevelNormalisation)
        {
            BaseLevelNormalisation sourceLevelNormalisation = (BaseLevelNormalisation)(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);

        _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))); //
        _MeanWghtZScore = (Double)(HELPER_MeanWghtZScore.readExternal (_MeanWghtZScore, vals.get(FIELD_MeanWghtZScore))); //
        _MeanWghtZScores = (Double)(HELPER_MeanWghtZScores.readExternal (_MeanWghtZScores, vals.get(FIELD_MeanWghtZScores))); //
        _StdDevWghtZScore = (Double)(HELPER_StdDevWghtZScore.readExternal (_StdDevWghtZScore, vals.get(FIELD_StdDevWghtZScore))); //
        _StdDevWghtZScore2 = (Double)(HELPER_StdDevWghtZScore2.readExternal (_StdDevWghtZScore2, vals.get(FIELD_StdDevWghtZScore2))); //
        _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_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 (FIELD_MeanWghtZScore, HELPER_MeanWghtZScore.writeExternal (_MeanWghtZScore));
        vals.put (FIELD_MeanWghtZScores, HELPER_MeanWghtZScores.writeExternal (_MeanWghtZScores));
        vals.put (FIELD_StdDevWghtZScore, HELPER_StdDevWghtZScore.writeExternal (_StdDevWghtZScore));
        vals.put (FIELD_StdDevWghtZScore2, HELPER_StdDevWghtZScore2.writeExternal (_StdDevWghtZScore2));
        vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
        
    }


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

        if (other instanceof BaseLevelNormalisation)
        {
            BaseLevelNormalisation otherLevelNormalisation = (BaseLevelNormalisation)(other);

            
            if (!HELPER_MeanScore.compare(this._MeanScore, otherLevelNormalisation._MeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MeanScore, HELPER_MeanScore.toObject(this._MeanScore), HELPER_MeanScore.toObject(otherLevelNormalisation._MeanScore));
            }
            if (!HELPER_MaxScore.compare(this._MaxScore, otherLevelNormalisation._MaxScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MaxScore, HELPER_MaxScore.toObject(this._MaxScore), HELPER_MaxScore.toObject(otherLevelNormalisation._MaxScore));
            }
            if (!HELPER_MinScore.compare(this._MinScore, otherLevelNormalisation._MinScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MinScore, HELPER_MinScore.toObject(this._MinScore), HELPER_MinScore.toObject(otherLevelNormalisation._MinScore));
            }
            if (!HELPER_StddevScore.compare(this._StddevScore, otherLevelNormalisation._StddevScore))
            {
                listener.notifyFieldChange(this, other, FIELD_StddevScore, HELPER_StddevScore.toObject(this._StddevScore), HELPER_StddevScore.toObject(otherLevelNormalisation._StddevScore));
            }
            if (!HELPER_LeftMeanScore.compare(this._LeftMeanScore, otherLevelNormalisation._LeftMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_LeftMeanScore, HELPER_LeftMeanScore.toObject(this._LeftMeanScore), HELPER_LeftMeanScore.toObject(otherLevelNormalisation._LeftMeanScore));
            }
            if (!HELPER_RightMeanScore.compare(this._RightMeanScore, otherLevelNormalisation._RightMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_RightMeanScore, HELPER_RightMeanScore.toObject(this._RightMeanScore), HELPER_RightMeanScore.toObject(otherLevelNormalisation._RightMeanScore));
            }
            if (!HELPER_WghtMeanScore.compare(this._WghtMeanScore, otherLevelNormalisation._WghtMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtMeanScore, HELPER_WghtMeanScore.toObject(this._WghtMeanScore), HELPER_WghtMeanScore.toObject(otherLevelNormalisation._WghtMeanScore));
            }
            if (!HELPER_WghtStddevScore.compare(this._WghtStddevScore, otherLevelNormalisation._WghtStddevScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtStddevScore, HELPER_WghtStddevScore.toObject(this._WghtStddevScore), HELPER_WghtStddevScore.toObject(otherLevelNormalisation._WghtStddevScore));
            }
            if (!HELPER_WghtLeftMeanScore.compare(this._WghtLeftMeanScore, otherLevelNormalisation._WghtLeftMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtLeftMeanScore, HELPER_WghtLeftMeanScore.toObject(this._WghtLeftMeanScore), HELPER_WghtLeftMeanScore.toObject(otherLevelNormalisation._WghtLeftMeanScore));
            }
            if (!HELPER_WghtRightMeanScore.compare(this._WghtRightMeanScore, otherLevelNormalisation._WghtRightMeanScore))
            {
                listener.notifyFieldChange(this, other, FIELD_WghtRightMeanScore, HELPER_WghtRightMeanScore.toObject(this._WghtRightMeanScore), HELPER_WghtRightMeanScore.toObject(otherLevelNormalisation._WghtRightMeanScore));
            }
            if (!HELPER_MeanWghtZScore.compare(this._MeanWghtZScore, otherLevelNormalisation._MeanWghtZScore))
            {
                listener.notifyFieldChange(this, other, FIELD_MeanWghtZScore, HELPER_MeanWghtZScore.toObject(this._MeanWghtZScore), HELPER_MeanWghtZScore.toObject(otherLevelNormalisation._MeanWghtZScore));
            }
            if (!HELPER_MeanWghtZScores.compare(this._MeanWghtZScores, otherLevelNormalisation._MeanWghtZScores))
            {
                listener.notifyFieldChange(this, other, FIELD_MeanWghtZScores, HELPER_MeanWghtZScores.toObject(this._MeanWghtZScores), HELPER_MeanWghtZScores.toObject(otherLevelNormalisation._MeanWghtZScores));
            }
            if (!HELPER_StdDevWghtZScore.compare(this._StdDevWghtZScore, otherLevelNormalisation._StdDevWghtZScore))
            {
                listener.notifyFieldChange(this, other, FIELD_StdDevWghtZScore, HELPER_StdDevWghtZScore.toObject(this._StdDevWghtZScore), HELPER_StdDevWghtZScore.toObject(otherLevelNormalisation._StdDevWghtZScore));
            }
            if (!HELPER_StdDevWghtZScore2.compare(this._StdDevWghtZScore2, otherLevelNormalisation._StdDevWghtZScore2))
            {
                listener.notifyFieldChange(this, other, FIELD_StdDevWghtZScore2, HELPER_StdDevWghtZScore2.toObject(this._StdDevWghtZScore2), HELPER_StdDevWghtZScore2.toObject(otherLevelNormalisation._StdDevWghtZScore2));
            }

            // Compare single assocs
            _Level.compare (otherLevelNormalisation._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_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.visitField(this, FIELD_MeanWghtZScore, HELPER_MeanWghtZScore.toObject(getMeanWghtZScore()));
        visitor.visitField(this, FIELD_MeanWghtZScores, HELPER_MeanWghtZScores.toObject(getMeanWghtZScores()));
        visitor.visitField(this, FIELD_StdDevWghtZScore, HELPER_StdDevWghtZScore.toObject(getStdDevWghtZScore()));
        visitor.visitField(this, FIELD_StdDevWghtZScore2, HELPER_StdDevWghtZScore2.toObject(getStdDevWghtZScore2()));
        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 LevelNormalisation createLevelNormalisation (ObjectTransaction transaction) throws StorageException
    {
        LevelNormalisation     result = new LevelNormalisation ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static LevelNormalisation getLevelNormalisationByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (LevelNormalisation)(transaction.getObjectByID (REFERENCE_LevelNormalisation, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        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 (FIELD_MeanWghtZScore))
        {
            return filter.matches (getMeanWghtZScore ());
        }
        else if (attribName.equals (FIELD_MeanWghtZScores))
        {
            return filter.matches (getMeanWghtZScores ());
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore))
        {
            return filter.matches (getStdDevWghtZScore ());
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore2))
        {
            return filter.matches (getStdDevWghtZScore2 ());
        }
        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<LevelNormalisation>
    {
        
            public SearchAll andObjectID (QueryFilter<Long> filter)
            {
                filter.addFilter (context, "tl_level_norm.object_id", FIELD_ObjectID);
                return this;
            }

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

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

            
            public SearchAll andMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.mean_score", "MeanScore");
                return this;
            }
            
            public SearchAll andMaxScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.max_score", "MaxScore");
                return this;
            }
            
            public SearchAll andMinScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.min_score", "MinScore");
                return this;
            }
            
            public SearchAll andStddevScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.stddev_score", "StddevScore");
                return this;
            }
            
            public SearchAll andLeftMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.left_mean_score", "LeftMeanScore");
                return this;
            }
            
            public SearchAll andRightMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.right_mean_score", "RightMeanScore");
                return this;
            }
            
            public SearchAll andWghtMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.wght_mean_score", "WghtMeanScore");
                return this;
            }
            
            public SearchAll andWghtStddevScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.wght_stddev_score", "WghtStddevScore");
                return this;
            }
            
            public SearchAll andWghtLeftMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.wght_left_mean_score", "WghtLeftMeanScore");
                return this;
            }
            
            public SearchAll andWghtRightMeanScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.wght_right_mean_score", "WghtRightMeanScore");
                return this;
            }
            
            public SearchAll andMeanWghtZScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.mean_wght_z_score", "MeanWghtZScore");
                return this;
            }
            
            public SearchAll andMeanWghtZScores (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.mean_wght_z_score_2", "MeanWghtZScores");
                return this;
            }
            
            public SearchAll andStdDevWghtZScore (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.stddev_wght_z_score", "StdDevWghtZScore");
                return this;
            }
            
            public SearchAll andStdDevWghtZScore2 (QueryFilter<Double> filter)
            {
                filter.addFilter (context, "tl_level_norm.stddev_wght_z_score_2", "StdDevWghtZScore2");
                return this;
            }
            
            public SearchAll andLevel (QueryFilter<Level> filter)
            {
                filter.addFilter (context, "tl_level_norm.level_number", "Level");
                return this;
            }
            
                public LevelNormalisation[]
             search (ObjectTransaction transaction) throws StorageException
        {
            
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_LevelNormalisation, SEARCH_All, criteria);
            Set<LevelNormalisation>   typedResults = new LinkedHashSet <LevelNormalisation> ();
            for (BaseBusinessClass bbcResult : results)
            {
                LevelNormalisation aResult = (LevelNormalisation)bbcResult;
                
                typedResults.add (aResult);
            }
            
                    return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new LevelNormalisation[0]);
                            
        }
    }

        
                public static LevelNormalisation[]
             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_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 if (attribName.equals (FIELD_MeanWghtZScore))
        {
            return HELPER_MeanWghtZScore.toObject (getMeanWghtZScore ());
        }
        else if (attribName.equals (FIELD_MeanWghtZScores))
        {
            return HELPER_MeanWghtZScores.toObject (getMeanWghtZScores ());
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore))
        {
            return HELPER_StdDevWghtZScore.toObject (getStdDevWghtZScore ());
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore2))
        {
            return HELPER_StdDevWghtZScore2.toObject (getStdDevWghtZScore2 ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        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 if (attribName.equals (FIELD_MeanWghtZScore))
        {
            return HELPER_MeanWghtZScore;
        }
        else if (attribName.equals (FIELD_MeanWghtZScores))
        {
            return HELPER_MeanWghtZScores;
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore))
        {
            return HELPER_StdDevWghtZScore;
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore2))
        {
            return HELPER_StdDevWghtZScore2;
        }
        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_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 if (attribName.equals (FIELD_MeanWghtZScore))
        {
            setMeanWghtZScore ((Double)(HELPER_MeanWghtZScore.fromObject (_MeanWghtZScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_MeanWghtZScores))
        {
            setMeanWghtZScores ((Double)(HELPER_MeanWghtZScores.fromObject (_MeanWghtZScores, attribValue)));            
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore))
        {
            setStdDevWghtZScore ((Double)(HELPER_StdDevWghtZScore.fromObject (_StdDevWghtZScore, attribValue)));            
        }
        else if (attribName.equals (FIELD_StdDevWghtZScore2))
        {
            setStdDevWghtZScore2 ((Double)(HELPER_StdDevWghtZScore2.fromObject (_StdDevWghtZScore2, 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_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 (FIELD_MeanWghtZScore))
        {
            return getWriteability_MeanWghtZScore ();
        }
        else if (fieldName.equals (FIELD_MeanWghtZScores))
        {
            return getWriteability_MeanWghtZScores ();
        }
        else if (fieldName.equals (FIELD_StdDevWghtZScore))
        {
            return getWriteability_StdDevWghtZScore ();
        }
        else if (fieldName.equals (FIELD_StdDevWghtZScore2))
        {
            return getWriteability_StdDevWghtZScore2 ();
        }
        else if (fieldName.equals (SINGLEREFERENCE_Level))
        {
            return getWriteability_Level ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        
            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);
            }
        
            if (getWriteability_MeanWghtZScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MeanWghtZScore);
            }
        
            if (getWriteability_MeanWghtZScores () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_MeanWghtZScores);
            }
        
            if (getWriteability_StdDevWghtZScore () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_StdDevWghtZScore);
            }
        
            if (getWriteability_StdDevWghtZScore2 () != FieldWriteability.TRUE)
            {
                fields.add (FIELD_StdDevWghtZScore2);
            }
        

        super.putUnwriteable (fields);
    }

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

        
        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));
        result.add(HELPER_MeanWghtZScore.getAttribObject (getClass (), _MeanWghtZScore, false, FIELD_MeanWghtZScore));
        result.add(HELPER_MeanWghtZScores.getAttribObject (getClass (), _MeanWghtZScores, false, FIELD_MeanWghtZScores));
        result.add(HELPER_StdDevWghtZScore.getAttribObject (getClass (), _StdDevWghtZScore, false, FIELD_StdDevWghtZScore));
        result.add(HELPER_StdDevWghtZScore2.getAttribObject (getClass (), _StdDevWghtZScore2, false, FIELD_StdDevWghtZScore2));

        return result;
    }


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Get the attribute MeanWghtZScore
     */
    public Double getMeanWghtZScore (LevelNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MeanWghtZScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setMeanWghtZScore (LevelNormalisation obj, Double newMeanWghtZScore) throws FieldException
    {
        return newMeanWghtZScore;
    }

    /**
     * Get the attribute MeanWghtZScores
     */
    public Double getMeanWghtZScores (LevelNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute MeanWghtZScores.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setMeanWghtZScores (LevelNormalisation obj, Double newMeanWghtZScores) throws FieldException
    {
        return newMeanWghtZScores;
    }

    /**
     * Get the attribute StdDevWghtZScore
     */
    public Double getStdDevWghtZScore (LevelNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute StdDevWghtZScore.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setStdDevWghtZScore (LevelNormalisation obj, Double newStdDevWghtZScore) throws FieldException
    {
        return newStdDevWghtZScore;
    }

    /**
     * Get the attribute StdDevWghtZScore2
     */
    public Double getStdDevWghtZScore2 (LevelNormalisation obj, Double original)
    {
        return original;
    }

    /**
     * Change the value set for attribute StdDevWghtZScore2.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Double setStdDevWghtZScore2 (LevelNormalisation obj, Double newStdDevWghtZScore2) throws FieldException
    {
        return newStdDevWghtZScore2;
    }

    }

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

        public LevelNormalisationPipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            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 ("MeanWghtZScore"))
            {
                return toMeanWghtZScore ();
            }                
            if (name.equals ("MeanWghtZScores"))
            {
                return toMeanWghtZScores ();
            }                
            if (name.equals ("StdDevWghtZScore"))
            {
                return toStdDevWghtZScore ();
            }                
            if (name.equals ("StdDevWghtZScore2"))
            {
                return toStdDevWghtZScore2 ();
            }                
            if (name.equals ("Level"))
            {
                return toLevel ();
            }                
            
            
            return super.to(name);
        }
        
        
        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 PipeLine<From, Double> toMeanWghtZScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_MeanWghtZScore));  }
        
        public PipeLine<From, Double> toMeanWghtZScores () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_MeanWghtZScores));  }
        
        public PipeLine<From, Double> toStdDevWghtZScore () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_StdDevWghtZScore));  }
        
        public PipeLine<From, Double> toStdDevWghtZScore2 () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_StdDevWghtZScore2));  }
        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 DummyLevelNormalisation extends LevelNormalisation
{
    // Default constructor primarily to support Externalisable
    public DummyLevelNormalisation()
    {
        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();
    }

}

    
