Class ModelEntity

java.lang.Object
org.ofbiz.core.entity.model.ModelEntity
All Implemented Interfaces:
Comparable<ModelEntity>
Direct Known Subclasses:
ModelViewEntity

public class ModelEntity extends Object implements Comparable<ModelEntity>
Generic Entity - Entity model class
Since:
2.0
Version:
$Revision: 1.3 $
Author:
David E. Jones, Andy Zeneski
  • Field Details

    • module

      public static final String module
    • STAMP_FIELD

      public static final String STAMP_FIELD
      The name of the time stamp field for locking/syncronization
      See Also:
    • modelReader

      protected ModelReader modelReader
      The ModelReader that created this Entity
    • entityName

      protected String entityName
      The entity-name of the Entity
    • tableName

      protected String tableName
      The table-name of the Entity
    • packageName

      protected String packageName
      The package-name of the Entity
    • dependentOn

      protected String dependentOn
      The entity-name of the Entity that this Entity is dependent on, if empty then no dependency
    • title

      protected String title
      The title for documentation purposes
    • description

      protected String description
      The description for documentation purposes
    • author

      protected String author
      The author for documentation purposes
    • version

      protected String version
      The version for documentation purposes
    • fields

      protected List<ModelField> fields
      A List of the Field objects for the Entity
    • fieldsMap

      protected Map<String,ModelField> fieldsMap
    • pks

      protected List<ModelField> pks
      A List of the Field objects for the Entity, one for each Primary Key
    • nopks

      protected List<ModelField> nopks
      A List of the Field objects for the Entity, one for each NON Primary Key
    • relations

      protected List<ModelRelation> relations
      relations defining relationships between this entity and other entities
    • indexes

      protected List<ModelIndex> indexes
      indexes on fields/columns in this entity
    • functionBasedIndexes

      protected List<ModelFunctionBasedIndex> functionBasedIndexes
      function based indexes in this entity
    • doLock

      protected boolean doLock
      An indicator to specify if this entity requires locking for updates
    • neverCache

      protected boolean neverCache
      An indicator to specify if this entity is never cached. If true causes the delegator to not clear caches on write and to not get from cache on read showing a warning messages to that effect
  • Constructor Details

  • Method Details

    • populateBasicInfo

      protected void populateBasicInfo(Element entityElement, Element docElement, Hashtable<String,String> docElementValues)
    • populateRelated

      protected void populateRelated(ModelReader reader, Element entityElement)
    • populateIndexes

      protected void populateIndexes(Element entityElement)
    • populateFunctionBasedIndexes

      protected void populateFunctionBasedIndexes(Element entityElement)
    • getModelReader

      public ModelReader getModelReader()
    • getEntityName

      public String getEntityName()
      The entity-name of the Entity
    • setEntityName

      public void setEntityName(String entityName)
    • getPlainTableName

      public String getPlainTableName()
      The plain table-name of the Entity without a schema name prefix
    • getTableName

      public String getTableName(String helperName)
      The table-name of the Entity including a Schema name if specified in the datasource config
    • getTableName

      public String getTableName(DatasourceInfo datasourceInfo)
      The table-name of the Entity including a Schema name if specified in the datasource config
    • setTableName

      public void setTableName(String tableName)
    • getPackageName

      public String getPackageName()
      The package-name of the Entity
    • setPackageName

      public void setPackageName(String packageName)
    • getDependentOn

      public String getDependentOn()
      The entity-name of the Entity that this Entity is dependent on, if empty then no dependency
    • setDependentOn

      public void setDependentOn(String dependentOn)
    • getTitle

      public String getTitle()
      The title for documentation purposes
    • setTitle

      public void setTitle(String title)
    • getDescription

      public String getDescription()
      The description for documentation purposes
    • setDescription

      public void setDescription(String description)
    • getCopyright

      public String getCopyright()
      The copyright for documentation purposes
    • setCopyright

      public void setCopyright(String copyright)
    • getAuthor

      public String getAuthor()
      The author for documentation purposes
    • setAuthor

      public void setAuthor(String author)
    • getVersion

      public String getVersion()
      The version for documentation purposes
    • setVersion

      public void setVersion(String version)
    • getNeverCache

      public boolean getNeverCache()
      An indicator to specify if this entity is never cached. If true causes the delegator to not clear caches on write and to not get from cache on read showing a warning messages to that effect
    • setNeverCache

      public void setNeverCache(boolean neverCache)
    • getDoLock

      public boolean getDoLock()
      An indicator to specify if this entity requires locking for updates
    • setDoLock

      public void setDoLock(boolean doLock)
    • lock

      public boolean lock()
    • updatePkLists

      public void updatePkLists()
    • isField

      public boolean isField(String fieldName)
    • areFields

      public boolean areFields(Collection<String> fieldNames)
    • getPksSize

      public int getPksSize()
    • getPk

      public ModelField getPk(int index)
    • getPksIterator

      public Iterator<ModelField> getPksIterator()
    • getPksCopy

      public List<ModelField> getPksCopy()
    • getNopksSize

      public int getNopksSize()
    • getNopk

      public ModelField getNopk(int index)
    • getNopksIterator

      public Iterator<ModelField> getNopksIterator()
    • getNopksCopy

      public List<ModelField> getNopksCopy()
    • getFieldsSize

      public int getFieldsSize()
    • getField

      public ModelField getField(int index)
    • getFieldsIterator

      public Iterator<ModelField> getFieldsIterator()
    • getFieldsCopy

      public List<ModelField> getFieldsCopy()
    • getField

      public ModelField getField(String fieldName)
    • addField

      public void addField(ModelField field)
    • removeField

      public ModelField removeField(int index)
    • removeField

      public ModelField removeField(String fieldName)
    • getAllFieldNames

      public List<String> getAllFieldNames()
    • getPkFieldNames

      public List<String> getPkFieldNames()
    • getNoPkFieldNames

      public List<String> getNoPkFieldNames()
    • getFieldNamesFromFieldVector

      public List<String> getFieldNamesFromFieldVector(List<ModelField> modelFields)
    • getRelationsSize

      public int getRelationsSize()
    • getRelation

      public ModelRelation getRelation(int index)
    • getRelationsIterator

      public Iterator<ModelRelation> getRelationsIterator()
    • getRelation

      public ModelRelation getRelation(String relationName)
    • addRelation

      public void addRelation(ModelRelation relation)
    • removeRelation

      public ModelRelation removeRelation(int index)
    • getIndexesSize

      public int getIndexesSize()
    • getIndex

      public ModelIndex getIndex(int index)
    • getIndexesIterator

      public Iterator<ModelIndex> getIndexesIterator()
    • getIndex

      public ModelIndex getIndex(String indexName)
    • addIndex

      public void addIndex(ModelIndex index)
    • removeIndex

      public ModelIndex removeIndex(int index)
    • getFunctionBasedIndexesIterator

      public Iterator<ModelFunctionBasedIndex> getFunctionBasedIndexesIterator()
    • addFunctionBasedIndex

      public void addFunctionBasedIndex(ModelFunctionBasedIndex fbindex)
    • nameString

      public String nameString(List<ModelField> flds)
    • nameString

      public String nameString(List<ModelField> flds, String separator, String afterLast)
    • typeNameString

      public String typeNameString(List<ModelField> flds)
    • fieldNameString

      public String fieldNameString()
    • fieldNameString

      public String fieldNameString(String separator, String afterLast)
    • fieldTypeNameString

      public String fieldTypeNameString()
    • primKeyClassNameString

      public String primKeyClassNameString()
    • pkNameString

      public String pkNameString()
    • pkNameString

      public String pkNameString(String separator, String afterLast)
    • nonPkNullList

      public String nonPkNullList()
    • fieldsStringList

      public String fieldsStringList(List<ModelField> flds, String eachString, String separator)
    • fieldsStringList

      public String fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex)
    • fieldsStringList

      public String fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex, boolean onlyNonPK)
    • colNameString

      public String colNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper)
    • colNameString

      public String colNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper)
    • classNameString

      public String classNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper)
    • classNameString

      public String classNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper)
    • finderQueryString

      public String finderQueryString(List<ModelField> flds)
    • httpArgList

      public String httpArgList(List<ModelField> flds)
    • httpArgListFromClass

      public String httpArgListFromClass(List<ModelField> flds)
    • httpArgListFromClass

      public String httpArgListFromClass(List<ModelField> flds, String entityNameSuffix)
    • httpRelationArgList

      public String httpRelationArgList(List<ModelField> flds, ModelRelation relation)
    • typeNameStringRelatedNoMapped

      public String typeNameStringRelatedNoMapped(List<ModelField> flds, ModelRelation relation)
    • typeNameStringRelatedAndMain

      public String typeNameStringRelatedAndMain(List<ModelField> flds, ModelRelation relation)
    • compareTo

      public int compareTo(ModelEntity obj)
      Specified by:
      compareTo in interface Comparable<ModelEntity>