/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.queplix.core.jxb.entity;

//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

import java.util.ArrayList;

/**
 * The entity descriptor type
 *
 * @version $Revision$ $Date$
 */
public class EntityViewType extends com.queplix.core.utils.jxb.JXBObject
        implements java.io.Serializable {

    //--------------------------/
    //- Class/Member Variables -/
    //--------------------------/

    /**
     * The entity name
     */
    private java.lang.String _name;

    /**
     * The name of DataBase object (table, view, etc.)
     */
    private java.lang.String _dbobject;

    /**
     * Entity schema name (see entityschema.xsd)
     */
    private java.lang.String _dbschema;

    /**
     * Is entity initialized or requires getting meta information
     * from dbschema
     */
    private java.lang.Boolean _initialized = new java.lang.Boolean("false");

    /**
     * The name of field for list-representation of record
     */
    private java.lang.String _listfield;

    /**
     * The name of field for history
     */
    private java.lang.String _historyfield;

    /**
     * Is entity cacheable in the memory
     */
    private java.lang.Boolean _cache = new java.lang.Boolean("false");

    /**
     * Attribute is reserved for internal purposes only
     */
    private java.lang.Boolean _hasHistoryFields = new java.lang.Boolean(
            "false");

    /**
     * Attribute is reserved for internal purposes only
     */
    private java.lang.String _pkeyfield;

    /**
     * Attribute is reserved for internal purposes only
     */
    private java.lang.String _dbobjAlias;

    /**
     * Attribute is reserved for internal purposes only
     */
    private java.lang.Long _versionId;

    /**
     * Hardcoded EQL meta-information for this entity. Used in EQL
     * EXT module only.
     */
    private java.util.ArrayList _metainfList;

    /**
     * The entity field description
     */
    private java.util.ArrayList _efieldList;

    /**
     * The dataset description
     */
    private java.util.ArrayList _datasetList;

    /**
     * The custom update scripts description
     */
    private com.queplix.core.jxb.entity.Scripts _scripts;

    /**
     * The foreign table dependence descriptor. Auto-generated by
     * system.
     */
    private java.util.ArrayList _fkeysList;

    /**
     * The constant eql-constraints, used without any limitations
     */
    private java.lang.String _eqlConstraint;

    /**
     * The dynamically eql-constraints for direct request to
     * entity, not used with any type of joining
     */
    private java.lang.String _eqlWhere;

    /**
     * The result's default order type
     */
    private java.lang.String _eqlOrder;

    /**
     * The child entity description
     */
    private java.util.ArrayList _entityList;

    /**
     * Auto-generated element. Never don't use it.
     */
    private java.util.ArrayList _chainTableList;

    //----------------/
    //- Constructors -/
    //----------------/

    public EntityViewType() {
        super();
        _metainfList = new ArrayList();
        _efieldList = new ArrayList();
        _datasetList = new ArrayList();
        _fkeysList = new ArrayList();
        _entityList = new ArrayList();
        _chainTableList = new ArrayList();
    } //-- com.queplix.core.jxb.entity.EntityViewType()

    //-----------/
    //- Methods -/
    //-----------/

    /**
     * Method addChainTable
     *
     * @param vChainTable
     */
    public void addChainTable(
            com.queplix.core.jxb.entity.ChainTable vChainTable)
            throws java.lang.IndexOutOfBoundsException {
        _chainTableList.add(vChainTable);
    } //-- void addChainTable(com.queplix.core.jxb.entity.ChainTable) 

    /**
     * Method addChainTable
     *
     * @param index
     * @param vChainTable
     */
    public void addChainTable(int index,
                              com.queplix.core.jxb.entity.ChainTable vChainTable)
            throws java.lang.IndexOutOfBoundsException {
        _chainTableList.add(index, vChainTable);
    } //-- void addChainTable(int, com.queplix.core.jxb.entity.ChainTable) 

    /**
     * Method addDataset
     *
     * @param vDataset
     */
    public void addDataset(com.queplix.core.jxb.entity.Dataset vDataset)
            throws java.lang.IndexOutOfBoundsException {
        _datasetList.add(vDataset);
    } //-- void addDataset(com.queplix.core.jxb.entity.Dataset) 

    /**
     * Method addDataset
     *
     * @param index
     * @param vDataset
     */
    public void addDataset(int index,
                           com.queplix.core.jxb.entity.Dataset vDataset)
            throws java.lang.IndexOutOfBoundsException {
        _datasetList.add(index, vDataset);
    } //-- void addDataset(int, com.queplix.core.jxb.entity.Dataset) 

    /**
     * Method addEfield
     *
     * @param vEfield
     */
    public void addEfield(com.queplix.core.jxb.entity.Efield vEfield)
            throws java.lang.IndexOutOfBoundsException {
        _efieldList.add(vEfield);
    } //-- void addEfield(com.queplix.core.jxb.entity.Efield) 

    /**
     * Method addEfield
     *
     * @param index
     * @param vEfield
     */
    public void addEfield(int index, com.queplix.core.jxb.entity.Efield vEfield)
            throws java.lang.IndexOutOfBoundsException {
        _efieldList.add(index, vEfield);
    } //-- void addEfield(int, com.queplix.core.jxb.entity.Efield) 

    /**
     * Method addEntity
     *
     * @param vEntity
     */
    public void addEntity(com.queplix.core.jxb.entity.Entity vEntity)
            throws java.lang.IndexOutOfBoundsException {
        _entityList.add(vEntity);
    } //-- void addEntity(com.queplix.core.jxb.entity.Entity) 

    /**
     * Method addEntity
     *
     * @param index
     * @param vEntity
     */
    public void addEntity(int index, com.queplix.core.jxb.entity.Entity vEntity)
            throws java.lang.IndexOutOfBoundsException {
        _entityList.add(index, vEntity);
    } //-- void addEntity(int, com.queplix.core.jxb.entity.Entity) 

    /**
     * Method addFkeys
     *
     * @param vFkeys
     */
    public void addFkeys(com.queplix.core.jxb.entity.Fkeys vFkeys)
            throws java.lang.IndexOutOfBoundsException {
        _fkeysList.add(vFkeys);
    } //-- void addFkeys(com.queplix.core.jxb.entity.Fkeys) 

    /**
     * Method addFkeys
     *
     * @param index
     * @param vFkeys
     */
    public void addFkeys(int index, com.queplix.core.jxb.entity.Fkeys vFkeys)
            throws java.lang.IndexOutOfBoundsException {
        _fkeysList.add(index, vFkeys);
    } //-- void addFkeys(int, com.queplix.core.jxb.entity.Fkeys) 

    /**
     * Method addMetainf
     *
     * @param vMetainf
     */
    public void addMetainf(com.queplix.core.jxb.entity.Metainf vMetainf)
            throws java.lang.IndexOutOfBoundsException {
        _metainfList.add(vMetainf);
    } //-- void addMetainf(com.queplix.core.jxb.entity.Metainf) 

    /**
     * Method addMetainf
     *
     * @param index
     * @param vMetainf
     */
    public void addMetainf(int index,
                           com.queplix.core.jxb.entity.Metainf vMetainf)
            throws java.lang.IndexOutOfBoundsException {
        _metainfList.add(index, vMetainf);
    } //-- void addMetainf(int, com.queplix.core.jxb.entity.Metainf) 

    /**
     * Method clearChainTable
     */
    public void clearChainTable() {
        _chainTableList.clear();
    } //-- void clearChainTable() 

    /**
     * Method clearDataset
     */
    public void clearDataset() {
        _datasetList.clear();
    } //-- void clearDataset() 

    /**
     * Method clearEfield
     */
    public void clearEfield() {
        _efieldList.clear();
    } //-- void clearEfield() 

    /**
     * Method clearEntity
     */
    public void clearEntity() {
        _entityList.clear();
    } //-- void clearEntity() 

    /**
     * Method clearFkeys
     */
    public void clearFkeys() {
        _fkeysList.clear();
    } //-- void clearFkeys() 

    /**
     * Method clearMetainf
     */
    public void clearMetainf() {
        _metainfList.clear();
    } //-- void clearMetainf() 

    /**
     * Method enumerateChainTable
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateChainTable() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _chainTableList.iterator());
    } //-- java.util.Enumeration enumerateChainTable() 

    /**
     * Method enumerateDataset
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateDataset() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _datasetList.iterator());
    } //-- java.util.Enumeration enumerateDataset() 

    /**
     * Method enumerateEfield
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateEfield() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _efieldList.iterator());
    } //-- java.util.Enumeration enumerateEfield() 

    /**
     * Method enumerateEntity
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateEntity() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _entityList.iterator());
    } //-- java.util.Enumeration enumerateEntity() 

    /**
     * Method enumerateFkeys
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateFkeys() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _fkeysList.iterator());
    } //-- java.util.Enumeration enumerateFkeys() 

    /**
     * Method enumerateMetainf
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateMetainf() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _metainfList.iterator());
    } //-- java.util.Enumeration enumerateMetainf() 

    /**
     * Returns the value of field 'cache'. The field 'cache' has
     * the following description: Is entity cacheable in the memory
     *
     * @return the value of field 'cache'.
     */
    public java.lang.Boolean getCache() {
        return this._cache;
    } //-- java.lang.Boolean getCache() 

    /**
     * Method getChainTable
     *
     * @param index
     * @return ChainTable
     */
    public com.queplix.core.jxb.entity.ChainTable getChainTable(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _chainTableList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.ChainTable) _chainTableList.get(
                index);
    } //-- com.queplix.core.jxb.entity.ChainTable getChainTable(int) 

    /**
     * Method getChainTable
     *
     * @return ChainTable
     */
    public com.queplix.core.jxb.entity.ChainTable[] getChainTable() {
        int size = _chainTableList.size();
        com.queplix.core.jxb.entity.ChainTable[] mArray
                = new com.queplix.core.jxb.entity.ChainTable[size];
        for(int index = 0; index < size; index++) {
            mArray[index]
                    = (com.queplix.core.jxb.entity.ChainTable) _chainTableList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.ChainTable[] getChainTable() 

    /**
     * Method getChainTableCount
     *
     * @return int
     */
    public int getChainTableCount() {
        return _chainTableList.size();
    } //-- int getChainTableCount() 

    /**
     * Method getDataset
     *
     * @param index
     * @return Dataset
     */
    public com.queplix.core.jxb.entity.Dataset getDataset(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _datasetList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.Dataset) _datasetList.get(index);
    } //-- com.queplix.core.jxb.entity.Dataset getDataset(int) 

    /**
     * Method getDataset
     *
     * @return Dataset
     */
    public com.queplix.core.jxb.entity.Dataset[] getDataset() {
        int size = _datasetList.size();
        com.queplix.core.jxb.entity.Dataset[] mArray
                = new com.queplix.core.jxb.entity.Dataset[size];
        for(int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.jxb.entity.Dataset) _datasetList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.Dataset[] getDataset() 

    /**
     * Method getDatasetCount
     *
     * @return int
     */
    public int getDatasetCount() {
        return _datasetList.size();
    } //-- int getDatasetCount() 

    /**
     * Returns the value of field 'dbobjAlias'. The field
     * 'dbobjAlias' has the following description: Attribute is
     * reserved for internal purposes only
     *
     * @return the value of field 'dbobjAlias'.
     */
    public java.lang.String getDbobjAlias() {
        return this._dbobjAlias;
    } //-- java.lang.String getDbobjAlias() 

    /**
     * Returns the value of field 'dbobject'. The field 'dbobject'
     * has the following description: The name of DataBase object
     * (table, view, etc.)
     *
     * @return the value of field 'dbobject'.
     */
    public java.lang.String getDbobject() {
        return this._dbobject;
    } //-- java.lang.String getDbobject() 

    /**
     * Returns the value of field 'dbschema'. The field 'dbschema'
     * has the following description: Entity schema name (see
     * entityschema.xsd)
     *
     * @return the value of field 'dbschema'.
     */
    public java.lang.String getDbschema() {
        return this._dbschema;
    } //-- java.lang.String getDbschema() 

    /**
     * Method getEfield
     *
     * @param index
     * @return Efield
     */
    public com.queplix.core.jxb.entity.Efield getEfield(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _efieldList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.Efield) _efieldList.get(index);
    } //-- com.queplix.core.jxb.entity.Efield getEfield(int) 

    /**
     * Method getEfield
     *
     * @return Efield
     */
    public com.queplix.core.jxb.entity.Efield[] getEfield() {
        int size = _efieldList.size();
        com.queplix.core.jxb.entity.Efield[] mArray
                = new com.queplix.core.jxb.entity.Efield[size];
        for(int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.jxb.entity.Efield) _efieldList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.Efield[] getEfield() 

    /**
     * Method getEfieldCount
     *
     * @return int
     */
    public int getEfieldCount() {
        return _efieldList.size();
    } //-- int getEfieldCount() 

    /**
     * Method getEntity
     *
     * @param index
     * @return Entity
     */
    public com.queplix.core.jxb.entity.Entity getEntity(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _entityList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.Entity) _entityList.get(index);
    } //-- com.queplix.core.jxb.entity.Entity getEntity(int) 

    /**
     * Method getEntity
     *
     * @return Entity
     */
    public com.queplix.core.jxb.entity.Entity[] getEntity() {
        int size = _entityList.size();
        com.queplix.core.jxb.entity.Entity[] mArray
                = new com.queplix.core.jxb.entity.Entity[size];
        for(int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.jxb.entity.Entity) _entityList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.Entity[] getEntity() 

    /**
     * Method getEntityCount
     *
     * @return int
     */
    public int getEntityCount() {
        return _entityList.size();
    } //-- int getEntityCount() 

    /**
     * Returns the value of field 'eqlConstraint'. The field
     * 'eqlConstraint' has the following description: The constant
     * eql-constraints, used without any limitations
     *
     * @return the value of field 'eqlConstraint'.
     */
    public java.lang.String getEqlConstraint() {
        return this._eqlConstraint;
    } //-- java.lang.String getEqlConstraint() 

    /**
     * Returns the value of field 'eqlOrder'. The field 'eqlOrder'
     * has the following description: The result's default order
     * type
     *
     * @return the value of field 'eqlOrder'.
     */
    public java.lang.String getEqlOrder() {
        return this._eqlOrder;
    } //-- java.lang.String getEqlOrder() 

    /**
     * Returns the value of field 'eqlWhere'. The field 'eqlWhere'
     * has the following description: The dynamically
     * eql-constraints for direct request to entity, not used with
     * any type of joining
     *
     * @return the value of field 'eqlWhere'.
     */
    public java.lang.String getEqlWhere() {
        return this._eqlWhere;
    } //-- java.lang.String getEqlWhere() 

    /**
     * Method getFkeys
     *
     * @param index
     * @return Fkeys
     */
    public com.queplix.core.jxb.entity.Fkeys getFkeys(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _fkeysList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.Fkeys) _fkeysList.get(index);
    } //-- com.queplix.core.jxb.entity.Fkeys getFkeys(int) 

    /**
     * Method getFkeys
     *
     * @return Fkeys
     */
    public com.queplix.core.jxb.entity.Fkeys[] getFkeys() {
        int size = _fkeysList.size();
        com.queplix.core.jxb.entity.Fkeys[] mArray
                = new com.queplix.core.jxb.entity.Fkeys[size];
        for(int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.jxb.entity.Fkeys) _fkeysList.get(
                    index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.Fkeys[] getFkeys() 

    /**
     * Method getFkeysCount
     *
     * @return int
     */
    public int getFkeysCount() {
        return _fkeysList.size();
    } //-- int getFkeysCount() 

    /**
     * Returns the value of field 'hasHistoryFields'. The field
     * 'hasHistoryFields' has the following description: Attribute
     * is reserved for internal purposes only
     *
     * @return the value of field 'hasHistoryFields'.
     */
    public java.lang.Boolean getHasHistoryFields() {
        return this._hasHistoryFields;
    } //-- java.lang.Boolean getHasHistoryFields() 

    /**
     * Returns the value of field 'historyfield'. The field
     * 'historyfield' has the following description: The name of
     * field for history
     *
     * @return the value of field 'historyfield'.
     */
    public java.lang.String getHistoryfield() {
        return this._historyfield;
    } //-- java.lang.String getHistoryfield() 

    /**
     * Returns the value of field 'initialized'. The field
     * 'initialized' has the following description: Is entity
     * initialized or requires getting meta information from
     * dbschema
     *
     * @return the value of field 'initialized'.
     */
    public java.lang.Boolean getInitialized() {
        return this._initialized;
    } //-- java.lang.Boolean getInitialized() 

    /**
     * Returns the value of field 'listfield'. The field
     * 'listfield' has the following description: The name of field
     * for list-representation of record
     *
     * @return the value of field 'listfield'.
     */
    public java.lang.String getListfield() {
        return this._listfield;
    } //-- java.lang.String getListfield() 

    /**
     * Method getMetainf
     *
     * @param index
     * @return Metainf
     */
    public com.queplix.core.jxb.entity.Metainf getMetainf(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _metainfList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.jxb.entity.Metainf) _metainfList.get(index);
    } //-- com.queplix.core.jxb.entity.Metainf getMetainf(int) 

    /**
     * Method getMetainf
     *
     * @return Metainf
     */
    public com.queplix.core.jxb.entity.Metainf[] getMetainf() {
        int size = _metainfList.size();
        com.queplix.core.jxb.entity.Metainf[] mArray
                = new com.queplix.core.jxb.entity.Metainf[size];
        for(int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.jxb.entity.Metainf) _metainfList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.jxb.entity.Metainf[] getMetainf() 

    /**
     * Method getMetainfCount
     *
     * @return int
     */
    public int getMetainfCount() {
        return _metainfList.size();
    } //-- int getMetainfCount() 

    /**
     * Returns the value of field 'name'. The field 'name' has the
     * following description: The entity name
     *
     * @return the value of field 'name'.
     */
    public java.lang.String getName() {
        return this._name;
    } //-- java.lang.String getName() 

    /**
     * Returns the value of field 'pkeyfield'. The field
     * 'pkeyfield' has the following description: Attribute is
     * reserved for internal purposes only
     *
     * @return the value of field 'pkeyfield'.
     */
    public java.lang.String getPkeyfield() {
        return this._pkeyfield;
    } //-- java.lang.String getPkeyfield() 

    /**
     * Returns the value of field 'scripts'. The field 'scripts'
     * has the following description: The custom update scripts
     * description
     *
     * @return the value of field 'scripts'.
     */
    public com.queplix.core.jxb.entity.Scripts getScripts() {
        return this._scripts;
    } //-- com.queplix.core.jxb.entity.Scripts getScripts() 

    /**
     * Returns the value of field 'versionId'. The field
     * 'versionId' has the following description: Attribute is
     * reserved for internal purposes only
     *
     * @return the value of field 'versionId'.
     */
    public java.lang.Long getVersionId() {
        return this._versionId;
    } //-- java.lang.Long getVersionId() 

    /**
     * Method isValid
     *
     * @return boolean
     */
    public boolean isValid() {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     *
     * @param out
     */
    public void marshal(java.io.Writer out)
            throws org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {

        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     *
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
            throws java.io.IOException, org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {

        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method removeChainTable
     *
     * @param vChainTable
     * @return boolean
     */
    public boolean removeChainTable(
            com.queplix.core.jxb.entity.ChainTable vChainTable) {
        boolean removed = _chainTableList.remove(vChainTable);
        return removed;
    } //-- boolean removeChainTable(com.queplix.core.jxb.entity.ChainTable) 

    /**
     * Method removeDataset
     *
     * @param vDataset
     * @return boolean
     */
    public boolean removeDataset(com.queplix.core.jxb.entity.Dataset vDataset) {
        boolean removed = _datasetList.remove(vDataset);
        return removed;
    } //-- boolean removeDataset(com.queplix.core.jxb.entity.Dataset) 

    /**
     * Method removeEfield
     *
     * @param vEfield
     * @return boolean
     */
    public boolean removeEfield(com.queplix.core.jxb.entity.Efield vEfield) {
        boolean removed = _efieldList.remove(vEfield);
        return removed;
    } //-- boolean removeEfield(com.queplix.core.jxb.entity.Efield) 

    /**
     * Method removeEntity
     *
     * @param vEntity
     * @return boolean
     */
    public boolean removeEntity(com.queplix.core.jxb.entity.Entity vEntity) {
        boolean removed = _entityList.remove(vEntity);
        return removed;
    } //-- boolean removeEntity(com.queplix.core.jxb.entity.Entity) 

    /**
     * Method removeFkeys
     *
     * @param vFkeys
     * @return boolean
     */
    public boolean removeFkeys(com.queplix.core.jxb.entity.Fkeys vFkeys) {
        boolean removed = _fkeysList.remove(vFkeys);
        return removed;
    } //-- boolean removeFkeys(com.queplix.core.jxb.entity.Fkeys) 

    /**
     * Method removeMetainf
     *
     * @param vMetainf
     * @return boolean
     */
    public boolean removeMetainf(com.queplix.core.jxb.entity.Metainf vMetainf) {
        boolean removed = _metainfList.remove(vMetainf);
        return removed;
    } //-- boolean removeMetainf(com.queplix.core.jxb.entity.Metainf) 

    /**
     * Sets the value of field 'cache'. The field 'cache' has the
     * following description: Is entity cacheable in the memory
     *
     * @param cache the value of field 'cache'.
     */
    public void setCache(java.lang.Boolean cache) {
        this._cache = cache;
    } //-- void setCache(java.lang.Boolean) 

    /**
     * Method setChainTable
     *
     * @param index
     * @param vChainTable
     */
    public void setChainTable(int index,
                              com.queplix.core.jxb.entity.ChainTable vChainTable)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _chainTableList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _chainTableList.set(index, vChainTable);
    } //-- void setChainTable(int, com.queplix.core.jxb.entity.ChainTable) 

    /**
     * Method setChainTable
     *
     * @param chainTableArray
     */
    public void setChainTable(
            com.queplix.core.jxb.entity.ChainTable[] chainTableArray) {
        //-- copy array
        _chainTableList.clear();
        for(int i = 0; i < chainTableArray.length; i++) {
            _chainTableList.add(chainTableArray[i]);
        }
    } //-- void setChainTable(com.queplix.core.jxb.entity.ChainTable) 

    /**
     * Method setDataset
     *
     * @param index
     * @param vDataset
     */
    public void setDataset(int index,
                           com.queplix.core.jxb.entity.Dataset vDataset)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _datasetList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _datasetList.set(index, vDataset);
    } //-- void setDataset(int, com.queplix.core.jxb.entity.Dataset) 

    /**
     * Method setDataset
     *
     * @param datasetArray
     */
    public void setDataset(com.queplix.core.jxb.entity.Dataset[] datasetArray) {
        //-- copy array
        _datasetList.clear();
        for(int i = 0; i < datasetArray.length; i++) {
            _datasetList.add(datasetArray[i]);
        }
    } //-- void setDataset(com.queplix.core.jxb.entity.Dataset) 

    /**
     * Sets the value of field 'dbobjAlias'. The field 'dbobjAlias'
     * has the following description: Attribute is reserved for
     * internal purposes only
     *
     * @param dbobjAlias the value of field 'dbobjAlias'.
     */
    public void setDbobjAlias(java.lang.String dbobjAlias) {
        this._dbobjAlias = dbobjAlias;
    } //-- void setDbobjAlias(java.lang.String) 

    /**
     * Sets the value of field 'dbobject'. The field 'dbobject' has
     * the following description: The name of DataBase object
     * (table, view, etc.)
     *
     * @param dbobject the value of field 'dbobject'.
     */
    public void setDbobject(java.lang.String dbobject) {
        this._dbobject = dbobject;
    } //-- void setDbobject(java.lang.String) 

    /**
     * Sets the value of field 'dbschema'. The field 'dbschema' has
     * the following description: Entity schema name (see
     * entityschema.xsd)
     *
     * @param dbschema the value of field 'dbschema'.
     */
    public void setDbschema(java.lang.String dbschema) {
        this._dbschema = dbschema;
    } //-- void setDbschema(java.lang.String) 

    /**
     * Method setEfield
     *
     * @param index
     * @param vEfield
     */
    public void setEfield(int index, com.queplix.core.jxb.entity.Efield vEfield)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _efieldList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _efieldList.set(index, vEfield);
    } //-- void setEfield(int, com.queplix.core.jxb.entity.Efield) 

    /**
     * Method setEfield
     *
     * @param efieldArray
     */
    public void setEfield(com.queplix.core.jxb.entity.Efield[] efieldArray) {
        //-- copy array
        _efieldList.clear();
        for(int i = 0; i < efieldArray.length; i++) {
            _efieldList.add(efieldArray[i]);
        }
    } //-- void setEfield(com.queplix.core.jxb.entity.Efield) 

    /**
     * Method setForm
     *
     * @param index
     * @param vEntity
     */
    public void setEntity(int index, com.queplix.core.jxb.entity.Entity vEntity)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _entityList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _entityList.set(index, vEntity);
    } //-- void setForm(int, com.queplix.core.jxb.entity.Entity)

    /**
     * Method setForm
     *
     * @param entityArray
     */
    public void setEntity(com.queplix.core.jxb.entity.Entity[] entityArray) {
        //-- copy array
        _entityList.clear();
        for(int i = 0; i < entityArray.length; i++) {
            _entityList.add(entityArray[i]);
        }
    } //-- void setForm(com.queplix.core.jxb.entity.Entity)

    /**
     * Sets the value of field 'eqlConstraint'. The field
     * 'eqlConstraint' has the following description: The constant
     * eql-constraints, used without any limitations
     *
     * @param eqlConstraint the value of field 'eqlConstraint'.
     */
    public void setEqlConstraint(java.lang.String eqlConstraint) {
        this._eqlConstraint = eqlConstraint;
    } //-- void setEqlConstraint(java.lang.String) 

    /**
     * Sets the value of field 'eqlOrder'. The field 'eqlOrder' has
     * the following description: The result's default order type
     *
     * @param eqlOrder the value of field 'eqlOrder'.
     */
    public void setEqlOrder(java.lang.String eqlOrder) {
        this._eqlOrder = eqlOrder;
    } //-- void setEqlOrder(java.lang.String) 

    /**
     * Sets the value of field 'eqlWhere'. The field 'eqlWhere' has
     * the following description: The dynamically eql-constraints
     * for direct request to entity, not used with any type of
     * joining
     *
     * @param eqlWhere the value of field 'eqlWhere'.
     */
    public void setEqlWhere(java.lang.String eqlWhere) {
        this._eqlWhere = eqlWhere;
    } //-- void setEqlWhere(java.lang.String) 

    /**
     * Method setFkeys
     *
     * @param index
     * @param vFkeys
     */
    public void setFkeys(int index, com.queplix.core.jxb.entity.Fkeys vFkeys)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _fkeysList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _fkeysList.set(index, vFkeys);
    } //-- void setFkeys(int, com.queplix.core.jxb.entity.Fkeys) 

    /**
     * Method setFkeys
     *
     * @param fkeysArray
     */
    public void setFkeys(com.queplix.core.jxb.entity.Fkeys[] fkeysArray) {
        //-- copy array
        _fkeysList.clear();
        for(int i = 0; i < fkeysArray.length; i++) {
            _fkeysList.add(fkeysArray[i]);
        }
    } //-- void setFkeys(com.queplix.core.jxb.entity.Fkeys) 

    /**
     * Sets the value of field 'hasHistoryFields'. The field
     * 'hasHistoryFields' has the following description: Attribute
     * is reserved for internal purposes only
     *
     * @param hasHistoryFields the value of field 'hasHistoryFields'
     */
    public void setHasHistoryFields(java.lang.Boolean hasHistoryFields) {
        this._hasHistoryFields = hasHistoryFields;
    } //-- void setHasHistoryFields(java.lang.Boolean) 

    /**
     * Sets the value of field 'historyfield'. The field
     * 'historyfield' has the following description: The name of
     * field for history
     *
     * @param historyfield the value of field 'historyfield'.
     */
    public void setHistoryfield(java.lang.String historyfield) {
        this._historyfield = historyfield;
    } //-- void setHistoryfield(java.lang.String) 

    /**
     * Sets the value of field 'initialized'. The field
     * 'initialized' has the following description: Is entity
     * initialized or requires getting meta information from
     * dbschema
     *
     * @param initialized the value of field 'initialized'.
     */
    public void setInitialized(java.lang.Boolean initialized) {
        this._initialized = initialized;
    } //-- void setInitialized(java.lang.Boolean) 

    /**
     * Sets the value of field 'listfield'. The field 'listfield'
     * has the following description: The name of field for
     * list-representation of record
     *
     * @param listfield the value of field 'listfield'.
     */
    public void setListfield(java.lang.String listfield) {
        this._listfield = listfield;
    } //-- void setListfield(java.lang.String) 

    /**
     * Method setMetainf
     *
     * @param index
     * @param vMetainf
     */
    public void setMetainf(int index,
                           com.queplix.core.jxb.entity.Metainf vMetainf)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _metainfList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _metainfList.set(index, vMetainf);
    } //-- void setMetainf(int, com.queplix.core.jxb.entity.Metainf) 

    /**
     * Method setMetainf
     *
     * @param metainfArray
     */
    public void setMetainf(com.queplix.core.jxb.entity.Metainf[] metainfArray) {
        //-- copy array
        _metainfList.clear();
        for(int i = 0; i < metainfArray.length; i++) {
            _metainfList.add(metainfArray[i]);
        }
    } //-- void setMetainf(com.queplix.core.jxb.entity.Metainf) 

    /**
     * Sets the value of field 'name'. The field 'name' has the
     * following description: The entity name
     *
     * @param name the value of field 'name'.
     */
    public void setName(java.lang.String name) {
        this._name = name;
    } //-- void setName(java.lang.String) 

    /**
     * Sets the value of field 'pkeyfield'. The field 'pkeyfield'
     * has the following description: Attribute is reserved for
     * internal purposes only
     *
     * @param pkeyfield the value of field 'pkeyfield'.
     */
    public void setPkeyfield(java.lang.String pkeyfield) {
        this._pkeyfield = pkeyfield;
    } //-- void setPkeyfield(java.lang.String) 

    /**
     * Sets the value of field 'scripts'. The field 'scripts' has
     * the following description: The custom update scripts
     * description
     *
     * @param scripts the value of field 'scripts'.
     */
    public void setScripts(com.queplix.core.jxb.entity.Scripts scripts) {
        this._scripts = scripts;
    } //-- void setScripts(com.queplix.core.jxb.entity.Scripts) 

    /**
     * Sets the value of field 'versionId'. The field 'versionId'
     * has the following description: Attribute is reserved for
     * internal purposes only
     *
     * @param versionId the value of field 'versionId'.
     */
    public void setVersionId(java.lang.Long versionId) {
        this._versionId = versionId;
    } //-- void setVersionId(java.lang.Long) 

    /**
     * Method unmarshal
     *
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
            throws org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {
        return (com.queplix.core.jxb.entity.EntityViewType) Unmarshaller
                .unmarshal(com.queplix.core.jxb.entity.EntityViewType.class,
                        reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     */
    public void validate()
            throws org.exolab.castor.xml.ValidationException {
        org.exolab.castor.xml.Validator validator
                = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
