Package org.ofbiz.core.entity.model
Class ModelEntity
java.lang.Object
org.ofbiz.core.entity.model.ModelEntity
- All Implemented Interfaces:
Comparable<ModelEntity>
- Direct Known Subclasses:
ModelViewEntity
Generic Entity - Entity model class
- Since:
- 2.0
- Version:
- $Revision: 1.3 $
- Author:
- David E. Jones, Andy Zeneski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe author for documentation purposesprotected StringThe copyright for documentation purposesprotected StringThe entity-name of the Entity that this Entity is dependent on, if empty then no dependencyprotected StringThe description for documentation purposesprotected booleanAn indicator to specify if this entity requires locking for updatesprotected StringThe entity-name of the Entityprotected List<ModelField>A List of the Field objects for the Entityprotected Map<String,ModelField> protected List<ModelFunctionBasedIndex>function based indexes in this entityprotected List<ModelIndex>indexes on fields/columns in this entityprotected ModelReaderThe ModelReader that created this Entitystatic final Stringprotected booleanAn indicator to specify if this entity is never cached.protected List<ModelField>A List of the Field objects for the Entity, one for each NON Primary Keyprotected StringThe package-name of the Entityprotected List<ModelField>A List of the Field objects for the Entity, one for each Primary Keyprotected List<ModelRelation>relations defining relationships between this entity and other entitiesstatic final StringThe name of the time stamp field for locking/syncronizationprotected StringThe table-name of the Entityprotected StringThe title for documentation purposesprotected StringThe version for documentation purposes -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorModelEntity(String tableName, List<DatabaseUtil.ColumnCheckInfo> colList, ModelFieldTypeReader modelFieldTypeReader) DB Names ConstructorModelEntity(ModelReader reader, Element entityElement, Element docElement, UtilTimer utilTimer, Hashtable<String, String> docElementValues) XML Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(ModelField field) voidvoidaddIndex(ModelIndex index) voidaddRelation(ModelRelation relation) booleanareFields(Collection<String> fieldNames) classNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper) classNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper) colNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper) colNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper) intcompareTo(ModelEntity obj) fieldNameString(String separator, String afterLast) fieldsStringList(List<ModelField> flds, String eachString, String separator) fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex) fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex, boolean onlyNonPK) finderQueryString(List<ModelField> flds) The author for documentation purposesThe copyright for documentation purposesThe entity-name of the Entity that this Entity is dependent on, if empty then no dependencyThe description for documentation purposesbooleanAn indicator to specify if this entity requires locking for updatesThe entity-name of the EntitygetField(int index) getFieldNamesFromFieldVector(List<ModelField> modelFields) intgetIndex(int index) intbooleanAn indicator to specify if this entity is never cached.getNopk(int index) intThe package-name of the EntitygetPk(int index) intThe plain table-name of the Entity without a schema name prefixgetRelation(int index) getRelation(String relationName) intgetTableName(String helperName) The table-name of the Entity including a Schema name if specified in the datasource configgetTableName(DatasourceInfo datasourceInfo) The table-name of the Entity including a Schema name if specified in the datasource configgetTitle()The title for documentation purposesThe version for documentation purposeshttpArgList(List<ModelField> flds) httpArgListFromClass(List<ModelField> flds) httpArgListFromClass(List<ModelField> flds, String entityNameSuffix) httpRelationArgList(List<ModelField> flds, ModelRelation relation) booleanbooleanlock()nameString(List<ModelField> flds) nameString(List<ModelField> flds, String separator, String afterLast) pkNameString(String separator, String afterLast) protected voidpopulateBasicInfo(Element entityElement, Element docElement, Hashtable<String, String> docElementValues) protected voidpopulateFunctionBasedIndexes(Element entityElement) protected voidpopulateIndexes(Element entityElement) protected voidpopulateRelated(ModelReader reader, Element entityElement) removeField(int index) removeField(String fieldName) removeIndex(int index) removeRelation(int index) voidvoidsetCopyright(String copyright) voidsetDependentOn(String dependentOn) voidsetDescription(String description) voidsetDoLock(boolean doLock) voidsetEntityName(String entityName) voidsetNeverCache(boolean neverCache) voidsetPackageName(String packageName) voidsetTableName(String tableName) voidvoidsetVersion(String version) typeNameString(List<ModelField> flds) typeNameStringRelatedAndMain(List<ModelField> flds, ModelRelation relation) typeNameStringRelatedNoMapped(List<ModelField> flds, ModelRelation relation) void
-
Field Details
-
module
-
STAMP_FIELD
The name of the time stamp field for locking/syncronization- See Also:
-
modelReader
The ModelReader that created this Entity -
entityName
The entity-name of the Entity -
tableName
The table-name of the Entity -
packageName
The package-name of the Entity -
dependentOn
The entity-name of the Entity that this Entity is dependent on, if empty then no dependency -
title
The title for documentation purposes -
description
The description for documentation purposes -
copyright
The copyright for documentation purposes -
author
The author for documentation purposes -
version
The version for documentation purposes -
fields
A List of the Field objects for the Entity -
fieldsMap
-
pks
A List of the Field objects for the Entity, one for each Primary Key -
nopks
A List of the Field objects for the Entity, one for each NON Primary Key -
relations
relations defining relationships between this entity and other entities -
indexes
indexes on fields/columns in this entity -
functionBasedIndexes
function based indexes in this entity -
doLock
protected boolean doLockAn indicator to specify if this entity requires locking for updates -
neverCache
protected boolean neverCacheAn 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
-
ModelEntity
public ModelEntity()Default Constructor -
ModelEntity
public ModelEntity(ModelReader reader, Element entityElement, Element docElement, UtilTimer utilTimer, Hashtable<String, String> docElementValues) XML Constructor -
ModelEntity
public ModelEntity(String tableName, List<DatabaseUtil.ColumnCheckInfo> colList, ModelFieldTypeReader modelFieldTypeReader) DB Names Constructor
-
-
Method Details
-
populateBasicInfo
-
populateRelated
-
populateIndexes
-
populateFunctionBasedIndexes
-
getModelReader
-
getEntityName
The entity-name of the Entity -
setEntityName
-
getPlainTableName
The plain table-name of the Entity without a schema name prefix -
getTableName
The table-name of the Entity including a Schema name if specified in the datasource config -
getTableName
The table-name of the Entity including a Schema name if specified in the datasource config -
setTableName
-
getPackageName
The package-name of the Entity -
setPackageName
-
getDependentOn
The entity-name of the Entity that this Entity is dependent on, if empty then no dependency -
setDependentOn
-
getTitle
The title for documentation purposes -
setTitle
-
getDescription
The description for documentation purposes -
setDescription
-
getCopyright
The copyright for documentation purposes -
setCopyright
-
getAuthor
The author for documentation purposes -
setAuthor
-
getVersion
The version for documentation purposes -
setVersion
-
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
-
areFields
-
getPksSize
public int getPksSize() -
getPk
-
getPksIterator
-
getPksCopy
-
getNopksSize
public int getNopksSize() -
getNopk
-
getNopksIterator
-
getNopksCopy
-
getFieldsSize
public int getFieldsSize() -
getField
-
getFieldsIterator
-
getFieldsCopy
-
getField
-
addField
-
removeField
-
removeField
-
getAllFieldNames
-
getPkFieldNames
-
getNoPkFieldNames
-
getFieldNamesFromFieldVector
-
getRelationsSize
public int getRelationsSize() -
getRelation
-
getRelationsIterator
-
getRelation
-
addRelation
-
removeRelation
-
getIndexesSize
public int getIndexesSize() -
getIndex
-
getIndexesIterator
-
getIndex
-
addIndex
-
removeIndex
-
getFunctionBasedIndexesIterator
-
addFunctionBasedIndex
-
nameString
-
nameString
-
typeNameString
-
fieldNameString
-
fieldNameString
-
fieldTypeNameString
-
primKeyClassNameString
-
pkNameString
-
pkNameString
-
nonPkNullList
-
fieldsStringList
-
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
-
colNameString
public String colNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper) -
classNameString
-
classNameString
public String classNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper) -
finderQueryString
-
httpArgList
-
httpArgListFromClass
-
httpArgListFromClass
-
httpRelationArgList
-
typeNameStringRelatedNoMapped
-
typeNameStringRelatedAndMain
-
compareTo
- Specified by:
compareToin interfaceComparable<ModelEntity>
-