public class ModelEntity extends Object implements Comparable<ModelEntity>
| Modifier and Type | Field and Description |
|---|---|
protected String |
author
The author for documentation purposes
|
protected String |
copyright
The copyright for documentation purposes
|
protected String |
dependentOn
The entity-name of the Entity that this Entity is dependent on, if empty then no dependency
|
protected String |
description
The description for documentation purposes
|
protected boolean |
doLock
An indicator to specify if this entity requires locking for updates
|
protected String |
entityName
The entity-name of the Entity
|
protected List<ModelField> |
fields
A List of the Field objects for the Entity
|
protected Map<String,ModelField> |
fieldsMap |
protected List<ModelFunctionBasedIndex> |
functionBasedIndexes
function based indexes in this entity
|
protected List<ModelIndex> |
indexes
indexes on fields/columns in this entity
|
protected ModelReader |
modelReader
The ModelReader that created this Entity
|
static String |
module |
protected boolean |
neverCache
An indicator to specify if this entity is never cached.
|
protected List<ModelField> |
nopks
A List of the Field objects for the Entity, one for each NON Primary Key
|
protected String |
packageName
The package-name of the Entity
|
protected List<ModelField> |
pks
A List of the Field objects for the Entity, one for each Primary Key
|
protected List<ModelRelation> |
relations
relations defining relationships between this entity and other entities
|
static String |
STAMP_FIELD
The name of the time stamp field for locking/syncronization
|
protected String |
tableName
The table-name of the Entity
|
protected String |
title
The title for documentation purposes
|
protected String |
version
The version for documentation purposes
|
| Constructor and Description |
|---|
ModelEntity()
Default Constructor
|
ModelEntity(ModelReader reader,
Element entityElement,
Element docElement,
UtilTimer utilTimer,
Hashtable<String,String> docElementValues)
XML Constructor
|
ModelEntity(String tableName,
List<DatabaseUtil.ColumnCheckInfo> colList,
ModelFieldTypeReader modelFieldTypeReader)
DB Names Constructor
|
public static final String module
public static final String STAMP_FIELD
protected ModelReader modelReader
protected String entityName
protected String tableName
protected String packageName
protected String dependentOn
protected String title
protected String description
protected String copyright
protected String author
protected String version
protected List<ModelField> fields
protected Map<String,ModelField> fieldsMap
protected List<ModelField> pks
protected List<ModelField> nopks
protected List<ModelRelation> relations
protected List<ModelIndex> indexes
protected List<ModelFunctionBasedIndex> functionBasedIndexes
protected boolean doLock
protected boolean neverCache
public ModelEntity()
public ModelEntity(ModelReader reader, Element entityElement, Element docElement, UtilTimer utilTimer, Hashtable<String,String> docElementValues)
public ModelEntity(String tableName, List<DatabaseUtil.ColumnCheckInfo> colList, ModelFieldTypeReader modelFieldTypeReader)
protected void populateBasicInfo(Element entityElement, Element docElement, Hashtable<String,String> docElementValues)
protected void populateRelated(ModelReader reader, Element entityElement)
protected void populateIndexes(Element entityElement)
protected void populateFunctionBasedIndexes(Element entityElement)
public ModelReader getModelReader()
public String getEntityName()
public void setEntityName(String entityName)
public String getPlainTableName()
public String getTableName(String helperName)
public String getTableName(DatasourceInfo datasourceInfo)
public void setTableName(String tableName)
public String getPackageName()
public void setPackageName(String packageName)
public String getDependentOn()
public void setDependentOn(String dependentOn)
public String getTitle()
public void setTitle(String title)
public String getDescription()
public void setDescription(String description)
public String getCopyright()
public void setCopyright(String copyright)
public String getAuthor()
public void setAuthor(String author)
public String getVersion()
public void setVersion(String version)
public boolean getNeverCache()
public void setNeverCache(boolean neverCache)
public boolean getDoLock()
public void setDoLock(boolean doLock)
public boolean lock()
public void updatePkLists()
public boolean isField(String fieldName)
public boolean areFields(Collection<String> fieldNames)
public int getPksSize()
public ModelField getPk(int index)
public Iterator<ModelField> getPksIterator()
public List<ModelField> getPksCopy()
public int getNopksSize()
public ModelField getNopk(int index)
public Iterator<ModelField> getNopksIterator()
public List<ModelField> getNopksCopy()
public int getFieldsSize()
public ModelField getField(int index)
public Iterator<ModelField> getFieldsIterator()
public List<ModelField> getFieldsCopy()
public ModelField getField(String fieldName)
public void addField(ModelField field)
public ModelField removeField(int index)
public ModelField removeField(String fieldName)
public List<String> getFieldNamesFromFieldVector(List<ModelField> modelFields)
public int getRelationsSize()
public ModelRelation getRelation(int index)
public Iterator<ModelRelation> getRelationsIterator()
public ModelRelation getRelation(String relationName)
public void addRelation(ModelRelation relation)
public ModelRelation removeRelation(int index)
public int getIndexesSize()
public ModelIndex getIndex(int index)
public Iterator<ModelIndex> getIndexesIterator()
public ModelIndex getIndex(String indexName)
public void addIndex(ModelIndex index)
public ModelIndex removeIndex(int index)
public Iterator<ModelFunctionBasedIndex> getFunctionBasedIndexesIterator()
public void addFunctionBasedIndex(ModelFunctionBasedIndex fbindex)
public String nameString(List<ModelField> flds)
public String nameString(List<ModelField> flds, String separator, String afterLast)
public String typeNameString(List<ModelField> flds)
public String fieldNameString()
public String fieldTypeNameString()
public String primKeyClassNameString()
public String pkNameString()
public String nonPkNullList()
public String fieldsStringList(List<ModelField> flds, String eachString, String separator)
public String fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex)
public String fieldsStringList(List<ModelField> flds, String eachString, String separator, boolean appendIndex, boolean onlyNonPK)
public String colNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper)
public String colNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper)
public String classNameString(List<ModelField> flds, SqlEscapeHelper sqlEscapeHelper)
public String classNameString(List<ModelField> flds, String separator, String afterLast, SqlEscapeHelper sqlEscapeHelper)
public String finderQueryString(List<ModelField> flds)
public String httpArgList(List<ModelField> flds)
public String httpArgListFromClass(List<ModelField> flds)
public String httpArgListFromClass(List<ModelField> flds, String entityNameSuffix)
public String httpRelationArgList(List<ModelField> flds, ModelRelation relation)
public String typeNameStringRelatedNoMapped(List<ModelField> flds, ModelRelation relation)
public String typeNameStringRelatedAndMain(List<ModelField> flds, ModelRelation relation)
public int compareTo(ModelEntity obj)
compareTo in interface Comparable<ModelEntity>Copyright © 2024 Atlassian. All rights reserved.