/*
 * IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
 * Template: Infrastructure9.0 [oneit.objstore.BusinessObjectTemplate.xsl]
 *   Vendor: Apache Software Foundation (Xalan XSLTC) (Version: 1.0)
 */
    
    
package performa.search;

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 oneit.servlets.orm.*;
import performa.orm.*;
import performa.orm.types.*;

// __#BUILD_NO_TABLE_NAME#: No table name == No persistence manager and scripts required.

public abstract class BaseSearchMessageTemplate extends SearchExecutor
{
    // Reference instance for the object
    public static final SearchMessageTemplate REFERENCE_SearchMessageTemplate = new SearchMessageTemplate ();

    // Reference instance for the object
    public static final SearchMessageTemplate DUMMY_SearchMessageTemplate = new DummySearchMessageTemplate ();

    // Static constants corresponding to field names
    
    public static final String FIELD_OnlyGlobalTemplate = "OnlyGlobalTemplate";

    // Static constants corresponding to searches
    

    // Static constants corresponding to attribute helpers
    private static final DefaultAttributeHelper<SearchMessageTemplate> HELPER_OnlyGlobalTemplate = DefaultAttributeHelper.INSTANCE;
    

    // Private attributes corresponding to business object data
    private Boolean _OnlyGlobalTemplate;
    

    // Private attributes corresponding to single references
    

    // Private attributes corresponding to multiple references
    

    // Map of maps of metadata
    private static final Map ATTRIBUTES_METADATA_SearchMessageTemplate = new LinkedHashMap ();

    // Arrays of validators for each attribute
    private static final AttributeValidator[] FIELD_OnlyGlobalTemplate_Validators;
    

    // Arrays of AttributeDecorators for each attribute
    private static final AttributeDecorator<SearchMessageTemplate, Boolean>[] FIELD_OnlyGlobalTemplate_Decorators;
    
    
    // Arrays of SingleAssocDecorators for each attribute
    
    
    // Arrays of MultiAssocDecorators for each attribute
    

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

            FIELD_OnlyGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_OnlyGlobalTemplate(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_OnlyGlobalTemplate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_SearchMessageTemplate, FIELD_OnlyGlobalTemplate).toArray (new AttributeDecorator[0]);
            

            REFERENCE_SearchMessageTemplate.initialiseReference ();
            DUMMY_SearchMessageTemplate.initialiseReference ();
            SearchMessageTemplate_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(SearchMessageTemplate.class).toArray(new SearchMessageTemplateBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

    
    private static List setupAttribMetaData_OnlyGlobalTemplate(Map validatorMapping)
    {
        Map  metaInfo   = new HashMap ();

        metaInfo.put ("name", "OnlyGlobalTemplate");
        metaInfo.put ("type", "Boolean");
        
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SearchMessageTemplate.OnlyGlobalTemplate:", metaInfo);
        ATTRIBUTES_METADATA_SearchMessageTemplate.put (FIELD_OnlyGlobalTemplate, Collections.unmodifiableMap (metaInfo));

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

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


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

    


    protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
    {
        super._initialiseNewObjAttributes (transaction);

        
        _OnlyGlobalTemplate = (Boolean)(HELPER_OnlyGlobalTemplate.initialise (_OnlyGlobalTemplate));
    }


    protected void _initialiseAssociations ()
    {
        super._initialiseAssociations ();

        
    }


    protected BaseBusinessClass initialiseReference ()
    {
        super.initialiseReference ();
        
        
        
        return this;
    }


    /**
     * Attribute OnlyGlobalTemplate
     */
    public Boolean getOnlyGlobalTemplate ()
    {
        assertValid();
        Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_OnlyGlobalTemplate_Decorators, (SearchMessageTemplate)this, FIELD_OnlyGlobalTemplate, _OnlyGlobalTemplate);

        
        for (SearchMessageTemplateBehaviourDecorator bhd : SearchMessageTemplate_BehaviourDecorators)
        {
            valToReturn = bhd.getOnlyGlobalTemplate ((SearchMessageTemplate)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 preOnlyGlobalTemplateChange (Boolean newOnlyGlobalTemplate) 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 postOnlyGlobalTemplateChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute OnlyGlobalTemplate.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setOnlyGlobalTemplate (Boolean newOnlyGlobalTemplate) throws FieldException
    {
        newOnlyGlobalTemplate = AttributeDecoratorUtils.setValue (FIELD_OnlyGlobalTemplate_Decorators, (SearchMessageTemplate)this, FIELD_OnlyGlobalTemplate, newOnlyGlobalTemplate);

        boolean oldAndNewIdentical = HELPER_OnlyGlobalTemplate.compare (_OnlyGlobalTemplate, newOnlyGlobalTemplate);
        
        try
        {
            for (SearchMessageTemplateBehaviourDecorator bhd : SearchMessageTemplate_BehaviourDecorators)
            {
                newOnlyGlobalTemplate = bhd.setOnlyGlobalTemplate ((SearchMessageTemplate)this, newOnlyGlobalTemplate);
                oldAndNewIdentical = HELPER_OnlyGlobalTemplate.compare (_OnlyGlobalTemplate, newOnlyGlobalTemplate);
            }

            

            if (FIELD_OnlyGlobalTemplate_Validators.length > 0)
            {
                Object newOnlyGlobalTemplateObj = HELPER_OnlyGlobalTemplate.toObject (newOnlyGlobalTemplate);

                if (newOnlyGlobalTemplateObj != null)
                {
                    int     loopMax = FIELD_OnlyGlobalTemplate_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_SearchMessageTemplate.get (FIELD_OnlyGlobalTemplate);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_OnlyGlobalTemplate_Decorators, (SearchMessageTemplate)this, FIELD_OnlyGlobalTemplate ,getWriteability_OnlyGlobalTemplate ()) != FieldWriteability.FALSE, "Field  OnlyGlobalTemplate is not writeable");
            preOnlyGlobalTemplateChange (newOnlyGlobalTemplate);
            markFieldChange (FIELD_OnlyGlobalTemplate);
            _OnlyGlobalTemplate = newOnlyGlobalTemplate;            
            postFieldChange (FIELD_OnlyGlobalTemplate);
            postOnlyGlobalTemplateChange ();
        }
    }



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

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


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


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


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


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



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

        return result;
    }


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

        return super.getMultiAssocReferenceInstance(attribName);
    }


    public String getMultiAssocBackReference(String attribName)
    {

        return super.getMultiAssocBackReference(attribName);
    }


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

        return super.getMultiAssocCount(attribName);
    }


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

        return super.getMultiAssocAt(attribName, index);
    }


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

        super.addToMultiAssoc(attribName, newElement);
    }

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

        super.removeFromMultiAssoc(attribName, oldElement);
    }


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

        super.__loadMultiAssoc(attribName, elements);
    }


    protected boolean __isMultiAssocLoaded (String attribName)
    {

        return super.__isMultiAssocLoaded(attribName);
    }




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

        super.onDelete ();
    }


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


    public SearchMessageTemplate referenceInstance ()
    {
        return REFERENCE_SearchMessageTemplate;
    }


    public SearchMessageTemplate getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getSearchMessageTemplateByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_SearchMessageTemplate;
    }


    public String getBaseSetName ()
    {
        return "";
    }



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

        PSet.setAttrib (FIELD_ObjectID, myID);
        PSet.setAttrib (FIELD_OnlyGlobalTemplate, HELPER_OnlyGlobalTemplate.toObject (_OnlyGlobalTemplate)); //
        
    }


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

        _OnlyGlobalTemplate = (Boolean)(HELPER_OnlyGlobalTemplate.fromObject (_OnlyGlobalTemplate, PSet.getAttrib (FIELD_OnlyGlobalTemplate))); //
        
    }


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

        if (other instanceof SearchMessageTemplate)
        {
            SearchMessageTemplate otherSearchMessageTemplate = (SearchMessageTemplate)other;
            

            try
            {
                setOnlyGlobalTemplate (otherSearchMessageTemplate.getOnlyGlobalTemplate ());
            }
            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 BaseSearchMessageTemplate)
        {
            BaseSearchMessageTemplate sourceSearchMessageTemplate = (BaseSearchMessageTemplate)(source);

            _OnlyGlobalTemplate = sourceSearchMessageTemplate._OnlyGlobalTemplate;
            
        }
    }


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

            
        }
    }


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

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

        _OnlyGlobalTemplate = (Boolean)(HELPER_OnlyGlobalTemplate.readExternal (_OnlyGlobalTemplate, vals.get(FIELD_OnlyGlobalTemplate))); //
        
    }


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

        vals.put (FIELD_OnlyGlobalTemplate, HELPER_OnlyGlobalTemplate.writeExternal (_OnlyGlobalTemplate));
        
    }


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

        if (other instanceof BaseSearchMessageTemplate)
        {
            BaseSearchMessageTemplate otherSearchMessageTemplate = (BaseSearchMessageTemplate)(other);

            
            if (!HELPER_OnlyGlobalTemplate.compare(this._OnlyGlobalTemplate, otherSearchMessageTemplate._OnlyGlobalTemplate))
            {
                listener.notifyFieldChange(this, other, FIELD_OnlyGlobalTemplate, HELPER_OnlyGlobalTemplate.toObject(this._OnlyGlobalTemplate), HELPER_OnlyGlobalTemplate.toObject(otherSearchMessageTemplate._OnlyGlobalTemplate));
            }

            // Compare single assocs
            

            // Compare multiple assocs
            
        }
    }


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

        
    }


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

        visitor.visitField(this, FIELD_OnlyGlobalTemplate, HELPER_OnlyGlobalTemplate.toObject(getOnlyGlobalTemplate()));
        
    }


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

        
    }


    public static SearchMessageTemplate createSearchMessageTemplate (ObjectTransaction transaction) throws StorageException
    {
        SearchMessageTemplate     result = new SearchMessageTemplate ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static SearchMessageTemplate getSearchMessageTemplateByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (SearchMessageTemplate)(transaction.getObjectByID (REFERENCE_SearchMessageTemplate, objectID));
    }

    public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_OnlyGlobalTemplate))
        {
            return filter.matches (getOnlyGlobalTemplate ());
        }
        else
        {
            return super.testFilter (attribName, filter);
        }
    }




    public Object getAttribute (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_OnlyGlobalTemplate))
        {
            return HELPER_OnlyGlobalTemplate.toObject (getOnlyGlobalTemplate ());
        }
        else
        {
            return super.getAttribute (attribName);
        }
    }


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_OnlyGlobalTemplate))
        {
            return HELPER_OnlyGlobalTemplate;
        }
        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_OnlyGlobalTemplate))
        {
            setOnlyGlobalTemplate ((Boolean)(HELPER_OnlyGlobalTemplate.fromObject (_OnlyGlobalTemplate, attribValue)));            
        }
        else
        {
            super.setAttribute (attribName, attribValue);
        }
    }

    

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

    public boolean isReadable ()
    {
        return super.isReadable();
    }

    public boolean isReadable (String fieldName)
    {
        return super.isReadable(fieldName);
    }


    public FieldWriteability getWriteable (String fieldName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (fieldName.equals (FIELD_OnlyGlobalTemplate))
        {
            return getWriteability_OnlyGlobalTemplate ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


    public void putUnwriteable (Set<String> fields)
    {
        if (getWriteability_OnlyGlobalTemplate () != FieldWriteability.TRUE)
        {
            fields.add (FIELD_OnlyGlobalTemplate);
        }
        

        super.putUnwriteable (fields);
    }

    // This generally means there's no specific persistence manager and we don't read or write from a table
    public boolean hasNoTable()
    {
        return true;
    }


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

        
        result.add(HELPER_OnlyGlobalTemplate.getAttribObject (getClass (), _OnlyGlobalTemplate, false, FIELD_OnlyGlobalTemplate));

        return result;
    }


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


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

    public void copyAllAttributeMetadata (Map copyInto)
    {
        super.copyAllAttributeMetadata(copyInto);

        copyInto.putAll(ATTRIBUTES_METADATA_SearchMessageTemplate);
    }
            

    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 SearchMessageTemplateBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<SearchMessageTemplate>
    {

    /**
     * Get the attribute OnlyGlobalTemplate
     */
    public Boolean getOnlyGlobalTemplate (SearchMessageTemplate obj, Boolean original)
    {
        return original;
    }

    /**
     * Change the value set for attribute OnlyGlobalTemplate.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public Boolean setOnlyGlobalTemplate (SearchMessageTemplate obj, Boolean newOnlyGlobalTemplate) throws FieldException
    {
        return newOnlyGlobalTemplate;
    }

    }

    @Override
    public ORMPipeLine pipes()
    {
        return new SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> ((SearchMessageTemplate)this);
    }

    @Override
    public ORMPipeLine pipes(Collection _items)
    {
        return pipesSearchMessageTemplate(_items);
    }
      
    /**
     * Use this instead of pipes() to get rid of type casting.
     */  
    public SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> pipelineSearchMessageTemplate()
    {
        return (SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate>) pipes();
    }
    
    public static SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> pipesSearchMessageTemplate(Collection<SearchMessageTemplate> items)
    {
        return REFERENCE_SearchMessageTemplate.new SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> (items);
    }
    
    public static SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> pipesSearchMessageTemplate(SearchMessageTemplate[] _items)
    {
        return pipesSearchMessageTemplate(Arrays.asList (_items));
    }
    
    public static SearchMessageTemplatePipeLineFactory<SearchMessageTemplate, SearchMessageTemplate> pipesSearchMessageTemplate()
    {
        return pipesSearchMessageTemplate((Collection)null);
    }
    
    
    public class SearchMessageTemplatePipeLineFactory<From extends BaseBusinessClass, Me extends SearchMessageTemplate> extends SearchExecutorPipeLineFactory<From, Me>    
    {
        public <Prev> SearchMessageTemplatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
        {
            super (pipeLine, nextPipe);
        }
        
        public SearchMessageTemplatePipeLineFactory (From seed)
        {
            super(seed);
        }

        public SearchMessageTemplatePipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("OnlyGlobalTemplate"))
            {
                return toOnlyGlobalTemplate ();
            }                
            
            
            return super.to(name);
        }
        
        
        public PipeLine<From, Boolean> toOnlyGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_OnlyGlobalTemplate));  }
    }
    
    public boolean isTransientAttrib(String attribName)
    {
        

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

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

    public void assertValid ()
    {
    }


}

    
