public class DbEntityDescriptor<E>
extends java.lang.Object
columns data
.Constructor and Description |
---|
DbEntityDescriptor(java.lang.Class<E> type,
java.lang.String schemaName,
TableNamingStrategy tableNamingStrategy,
ColumnNamingStrategy columnNamingStrategy) |
Modifier and Type | Method and Description |
---|---|
DbEntityColumnDescriptor |
findByColumnName(java.lang.String columnName)
Finds column descriptor by column name.
|
DbEntityColumnDescriptor |
findByPropertyName(java.lang.String propertyName)
Finds column descriptor by property name.
|
DbEntityColumnDescriptor[] |
getColumnDescriptors()
Returns the array of column descriptors.
|
java.lang.String |
getColumnName(java.lang.String propertyName)
Returns column name for specified property name..
|
int |
getColumnsCount()
Returns total number of columns.
|
java.lang.String |
getEntityName()
Returns type name.
|
java.lang.String |
getIdColumnName()
Returns the identity column name of column marked as identity.
|
int |
getIdColumnsCount()
Returns total number of identity columns.
|
java.lang.String |
getIdPropertyName()
Returns the first property name of column marked as identity.
|
java.lang.Object |
getIdValue(E object)
Returns ID value for given entity instance.
|
java.lang.String |
getKeyValue(E object)
Returns unique key for this entity.
|
java.lang.Class[] |
getMappedTypes()
Returns mapped types.
|
java.lang.String |
getPropertyName(java.lang.String columnName)
Returns property name for specified column name.
|
java.lang.String |
getSchemaName()
Returns schema name or
null if not available. |
java.lang.String |
getTableName()
Returns table name to which the entity is mapped.
|
java.lang.String |
getTableNameForQuery()
Returns table name to be used when generating queries.
|
java.lang.Class<E> |
getType()
Returns entity type.
|
boolean |
hasIdColumn()
Returns
true if entity has one ID column. |
protected void |
init()
Lazy initialization of descriptor.
|
boolean |
isAnnotated()
Returns
true if type is annotated with DbTable . |
void |
setIdValue(E object,
java.lang.Object value)
Sets ID value for given entity.
|
java.lang.String |
toString() |
public DbEntityDescriptor(java.lang.Class<E> type, java.lang.String schemaName, TableNamingStrategy tableNamingStrategy, ColumnNamingStrategy columnNamingStrategy)
public java.lang.Class<E> getType()
public boolean isAnnotated()
true
if type is annotated with DbTable
.public java.lang.String getTableName()
public java.lang.String getTableNameForQuery()
public java.lang.String getEntityName()
public java.lang.String getSchemaName()
null
if not available.public java.lang.Class[] getMappedTypes()
public DbEntityColumnDescriptor[] getColumnDescriptors()
protected void init()
public DbEntityColumnDescriptor findByColumnName(java.lang.String columnName)
public DbEntityColumnDescriptor findByPropertyName(java.lang.String propertyName)
public java.lang.String getPropertyName(java.lang.String columnName)
public java.lang.String getColumnName(java.lang.String propertyName)
public int getColumnsCount()
public int getIdColumnsCount()
public boolean hasIdColumn()
true
if entity has one ID column.public java.lang.String getIdColumnName()
public java.lang.String getIdPropertyName()
public java.lang.Object getIdValue(E object)
public void setIdValue(E object, java.lang.Object value)
public java.lang.String getKeyValue(E object)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2003-present Jodd Team