jodd.db.orm
Class DbEntityDescriptor

java.lang.Object
  extended by jodd.db.orm.DbEntityDescriptor

public class DbEntityDescriptor
extends java.lang.Object

Holds all information about some entity type, such as table name and columns data.


Constructor Summary
DbEntityDescriptor(java.lang.Class type, java.lang.String schemaName, java.lang.String tableNamePrefix, java.lang.String tableNameSuffix, boolean tableNameUppercase, boolean columnNameUppercase)
           
 
Method Summary
 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.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.Class getType()
          Returns entity type.
protected  void init()
          Lazy initialization of descriptor.
 boolean isAnnotated()
          Returns true if type is annotated with DbTable.
 boolean isColumnNameUppercase()
           
 boolean isTableNameUppercase()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbEntityDescriptor

public DbEntityDescriptor(java.lang.Class type,
                          java.lang.String schemaName,
                          java.lang.String tableNamePrefix,
                          java.lang.String tableNameSuffix,
                          boolean tableNameUppercase,
                          boolean columnNameUppercase)
Method Detail

getType

public java.lang.Class getType()
Returns entity type.


isAnnotated

public boolean isAnnotated()
Returns true if type is annotated with DbTable.


getTableName

public java.lang.String getTableName()
Returns table name to which the entity is mapped.


getEntityName

public java.lang.String getEntityName()
Returns type name.


getSchemaName

public java.lang.String getSchemaName()
Returns schema name or null if not available.


isColumnNameUppercase

public boolean isColumnNameUppercase()

isTableNameUppercase

public boolean isTableNameUppercase()

getColumnDescriptors

public DbEntityColumnDescriptor[] getColumnDescriptors()
Returns the array of column descriptors.


init

protected void init()
Lazy initialization of descriptor.


findByColumnName

public DbEntityColumnDescriptor findByColumnName(java.lang.String columnName)
Finds column descriptor by column name.


findByPropertyName

public DbEntityColumnDescriptor findByPropertyName(java.lang.String propertyName)
Finds column descriptor by property name.


getPropertyName

public java.lang.String getPropertyName(java.lang.String columnName)
Returns property name for specified column name.


getColumnName

public java.lang.String getColumnName(java.lang.String propertyName)
Returns column name for specified property name..


getColumnsCount

public int getColumnsCount()
Returns total number of columns.


getIdColumnsCount

public int getIdColumnsCount()
Returns total number of identity columns.


getIdColumnName

public java.lang.String getIdColumnName()
Returns the identity column name of column marked as identity. Throws an exception if table has composite primary key.


getIdPropertyName

public java.lang.String getIdPropertyName()
Returns the first property name of column marked as identity. Throws an exception if table has composite primary key.



Copyright © 2003-2011 Jodd Team