/*
 * 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.orm.types;

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.appservices.dbenums.*;


public abstract class BaseBO_Industry extends AbstractEnumeratedBO
{
    // Reference instance for the object
    public static final BO_Industry REFERENCE_BO_Industry = new BO_Industry ();

    // Reference instance for the object
    public static final BO_Industry DUMMY_BO_Industry = new DummyBO_Industry ();

    // Static constants corresponding to field names
    
    public static final String FIELD_Disabled = "Disabled";

    // Static constants corresponding to searches
    public static final String SEARCH_ALL = "ALL";
    public static final String SEARCH_BY_NAME = "BY_NAME";
    public static final String SEARCH_BY_VALUE = "BY_VALUE";
    

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

    // Private attributes corresponding to business object data
    private boolean _Disabled;
    

    // Private attributes corresponding to single references
    

    // Private attributes corresponding to multiple references
    

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

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

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

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

            FIELD_Disabled_Validators = (AttributeValidator[])setupAttribMetaData_Disabled(validatorMapping).toArray (new AttributeValidator[0]);
            FIELD_Disabled_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_BO_Industry, FIELD_Disabled).toArray (new AttributeDecorator[0]);
            

            REFERENCE_BO_Industry.initialiseReference ();
            DUMMY_BO_Industry.initialiseReference ();
            BO_Industry_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(BO_Industry.class).toArray(new BO_IndustryBehaviourDecorator[0]);
        }
        catch (RuntimeException e)
        {
            LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
            throw e;
        }
    }

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

        metaInfo.put ("dbcol", "DISABLED");
        metaInfo.put ("name", "Disabled");
        metaInfo.put ("type", "boolean");
        metaInfo.put (METADATA_DB_TABLENAME, "tl_industry");
        LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for BO_Industry.Disabled:", metaInfo);
        ATTRIBUTES_METADATA_BO_Industry.put (FIELD_Disabled, Collections.unmodifiableMap (metaInfo));

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

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


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

    


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

        
        _Disabled = (boolean)(HELPER_Disabled.initialise (_Disabled));
    }


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

        
    }


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


    /**
     * Attribute Disabled
     */
    public boolean getDisabled ()
    {
        assertValid();
        boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_Disabled_Decorators, (BO_Industry)this, FIELD_Disabled, _Disabled);

        
        for (BO_IndustryBehaviourDecorator bhd : BO_Industry_BehaviourDecorators)
        {
            valToReturn = bhd.getDisabled ((BO_Industry)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 preDisabledChange (boolean newDisabled) 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 postDisabledChange () throws FieldException
    {
    }

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

    /**
     * Set the attribute Disabled.  Checks to ensure a new value
     * has been supplied.  If so, marks the field as altered and sets the attribute.
     */
    public void setDisabled (boolean newDisabled) throws FieldException
    {
        newDisabled = AttributeDecoratorUtils.setValue (FIELD_Disabled_Decorators, (BO_Industry)this, FIELD_Disabled, newDisabled);

        boolean oldAndNewIdentical = HELPER_Disabled.compare (_Disabled, newDisabled);
        
        try
        {
            for (BO_IndustryBehaviourDecorator bhd : BO_Industry_BehaviourDecorators)
            {
                newDisabled = bhd.setDisabled ((BO_Industry)this, newDisabled);
                oldAndNewIdentical = HELPER_Disabled.compare (_Disabled, newDisabled);
            }

            

            if (FIELD_Disabled_Validators.length > 0)
            {
                Object newDisabledObj = HELPER_Disabled.toObject (newDisabled);

                if (newDisabledObj != null)
                {
                    int     loopMax = FIELD_Disabled_Validators.length;
                    Map     metadata = (Map)ATTRIBUTES_METADATA_BO_Industry.get (FIELD_Disabled);

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

        if (!oldAndNewIdentical)
        {
            assertValid();
            Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_Disabled_Decorators, (BO_Industry)this, FIELD_Disabled ,getWriteability_Disabled ()) != FieldWriteability.FALSE, "Field  Disabled is not writeable");
            preDisabledChange (newDisabled);
            markFieldChange (FIELD_Disabled);
            _Disabled = newDisabled;            
            postFieldChange (FIELD_Disabled);
            postDisabledChange ();
        }
    }



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


    public BO_Industry referenceInstance ()
    {
        return REFERENCE_BO_Industry;
    }


    public BO_Industry getInTransaction (ObjectTransaction t) throws StorageException
    {
        return getBO_IndustryByID (t, getObjectID());
    }
    
    
    public BaseBusinessClass dummyInstance ()
    {
        return DUMMY_BO_Industry;
    }


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



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

        tl_industryPSet.setAttrib (FIELD_ObjectID, myID);
        tl_industryPSet.setAttrib (FIELD_Disabled, HELPER_Disabled.toObject (_Disabled)); //
        
    }


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

        _Disabled = (boolean)(HELPER_Disabled.fromObject (_Disabled, tl_industryPSet.getAttrib (FIELD_Disabled))); //
        
    }


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

        if (other instanceof BO_Industry)
        {
            BO_Industry otherBO_Industry = (BO_Industry)other;
            

            try
            {
                setDisabled (otherBO_Industry.getDisabled ());
            }
            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 BaseBO_Industry)
        {
            BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(source);

            _Disabled = sourceBO_Industry._Disabled;
            
        }
    }


    /**
     * 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 BaseBO_Industry)
        {
            BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(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 BaseBO_Industry)
        {
            BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(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);

        _Disabled = (boolean)(HELPER_Disabled.readExternal (_Disabled, vals.get(FIELD_Disabled))); //
        
    }


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

        vals.put (FIELD_Disabled, HELPER_Disabled.writeExternal (_Disabled));
        
    }


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

        if (other instanceof BaseBO_Industry)
        {
            BaseBO_Industry otherBO_Industry = (BaseBO_Industry)(other);

            
            if (!HELPER_Disabled.compare(this._Disabled, otherBO_Industry._Disabled))
            {
                listener.notifyFieldChange(this, other, FIELD_Disabled, HELPER_Disabled.toObject(this._Disabled), HELPER_Disabled.toObject(otherBO_Industry._Disabled));
            }

            // 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_Disabled, HELPER_Disabled.toObject(getDisabled()));
        
    }


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

        
    }


    public static BO_Industry createBO_Industry (ObjectTransaction transaction) throws StorageException
    {
        BO_Industry     result = new BO_Industry ();

        result.initialiseNewObject (transaction);

        return result;
    }


    public static BO_Industry getBO_IndustryByID (ObjectTransaction transaction, Long objectID) throws StorageException
    {
        return (BO_Industry)(transaction.getObjectByID (REFERENCE_BO_Industry, objectID));
    }

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


    public static SearchALL SearchByALL () { return new SearchALL (); }

    public static class SearchALL extends SearchObject<BO_Industry>
    {
        public BO_Industry[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_ALL, criteria);
            Set<BO_Industry>   typedResults = new LinkedHashSet <BO_Industry> ();
            for (BaseBusinessClass bbcResult : results)
            {
                BO_Industry aResult = (BO_Industry)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
                            
        }
    }

        
    public static BO_Industry[] searchALL (ObjectTransaction transaction) throws StorageException
    {
        return SearchByALL ()
               .search (transaction);
    }

    public static SearchBY_NAME SearchByBY_NAME () { return new SearchBY_NAME (); }

    public static class SearchBY_NAME extends SearchObject<BO_Industry>
    {
        public SearchBY_NAME byName (String name)
        {
            by ("name", name);
            return this;
        }
        
        public BO_Industry[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_BY_NAME, criteria);
            Set<BO_Industry>   typedResults = new LinkedHashSet <BO_Industry> ();
            for (BaseBusinessClass bbcResult : results)
            {
                BO_Industry aResult = (BO_Industry)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
                            
        }
    }

        
    public static BO_Industry[] searchBY_NAME (ObjectTransaction transaction, String name) throws StorageException
    {
        return SearchByBY_NAME ()
               .byName  (name).search (transaction);
    }

    public static SearchBY_VALUE SearchByBY_VALUE () { return new SearchBY_VALUE (); }

    public static class SearchBY_VALUE extends SearchObject<BO_Industry>
    {
        public SearchBY_VALUE byValue (String value)
        {
            by ("value", value);
            return this;
        }
        
        public BO_Industry[] search (ObjectTransaction transaction) throws StorageException
        {
            
            BaseBusinessClass[]     results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_BY_VALUE, criteria);
            Set<BO_Industry>   typedResults = new LinkedHashSet <BO_Industry> ();
            for (BaseBusinessClass bbcResult : results)
            {
                BO_Industry aResult = (BO_Industry)bbcResult;
                
                typedResults.add (aResult);
            }
            
            return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
                            
        }
    }

        
    public static BO_Industry[] searchBY_VALUE (ObjectTransaction transaction, String value) throws StorageException
    {
        return SearchByBY_VALUE ()
               .byValue  (value).search (transaction);
    }



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


    public AttributeHelper getAttributeHelper (String attribName)
    {
        if (false)
        {
            throw new RuntimeException ("Game over man!!");
        }
        else if (attribName.equals (FIELD_Disabled))
        {
            return HELPER_Disabled;
        }
        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_Disabled))
        {
            setDisabled ((boolean)(HELPER_Disabled.fromObject (_Disabled, 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_Disabled))
        {
            return getWriteability_Disabled ();
        }
        else
        {
            return super.getWriteable (fieldName);
        }
    }


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

        super.putUnwriteable (fields);
    }

    public String[] getAllTableNames()
    {
        return new String[] {"tl_industry"};
    }
    
    public boolean isPolymorphic(String tableName)
    {
        return super.isPolymorphic(tableName);
    }


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

        
        result.add(HELPER_Disabled.getAttribObject (getClass (), _Disabled, false, FIELD_Disabled));

        return result;
    }


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


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

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

        copyInto.putAll(ATTRIBUTES_METADATA_BO_Industry);
    }
            

    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 BO_IndustryBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<BO_Industry>
    {

    /**
     * Get the attribute Disabled
     */
    public boolean getDisabled (BO_Industry obj, boolean original)
    {
        return original;
    }

    /**
     * Change the value set for attribute Disabled.
     * May modify the field beforehand
     * Occurs before validation.
     */
    public boolean setDisabled (BO_Industry obj, boolean newDisabled) throws FieldException
    {
        return newDisabled;
    }

    }

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

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

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

        return super.isTransientAttrib(attribName);
    }

    public boolean isTransientSingleReference(String assocName)
    {
        

        return super.isTransientSingleReference(assocName);
    }
}

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

    public void assertValid ()
    {
    }


}

    
