com.j256.ormlite.table
Class TableInfo<T,ID>

java.lang.Object
  extended by com.j256.ormlite.table.TableInfo<T,ID>

public class TableInfo<T,ID>
extends Object

Information about a database table including the associated tableName, class, constructor, and the included fields.

Author:
graywatson

Constructor Summary
TableInfo(ConnectionSource connectionSource, Dao<T,ID> dao, Class<T> dataClass)
          Creates a holder of information about a table/class.
TableInfo(DatabaseType databaseType, Dao<T,ID> dao, DatabaseTableConfig<T> tableConfig)
          Creates a holder of information about a table/class.
 
Method Summary
 T createObject()
          Create and return an object of this type using our reflection constructor.
static
<T,ID> T
createObject(Constructor<?> constructor, Dao<T,ID> dao)
          Create and return an object of this type using our reflection constructor.
 Constructor<T> getConstructor()
           
 Class<T> getDataClass()
          Return the class associated with this object-info.
 FieldType getFieldTypeByColumnName(String columnName)
          Return the FieldType associated with the columnName.
 FieldType[] getFieldTypes()
          Return the array of field types associated with the object.
 FieldType getIdField()
          Return the id-field associated with the object.
 String getTableName()
          Return the name of the table associated with the object.
 boolean isUpdatable()
          Return true if we can update this object via its ID.
 String objectToString(T object)
          Return a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableInfo

public TableInfo(ConnectionSource connectionSource,
                 Dao<T,ID> dao,
                 Class<T> dataClass)
          throws SQLException
Creates a holder of information about a table/class.

Parameters:
connectionSource - Source of our database connections.
dataClass - Class that we are holding information about.
Throws:
SQLException

TableInfo

public TableInfo(DatabaseType databaseType,
                 Dao<T,ID> dao,
                 DatabaseTableConfig<T> tableConfig)
          throws SQLException
Creates a holder of information about a table/class.

Parameters:
databaseType - Database type we are storing the class in.
tableConfig - Configuration for our table.
Throws:
SQLException
Method Detail

getDataClass

public Class<T> getDataClass()
Return the class associated with this object-info.


getTableName

public String getTableName()
Return the name of the table associated with the object.


getFieldTypes

public FieldType[] getFieldTypes()
Return the array of field types associated with the object.


getFieldTypeByColumnName

public FieldType getFieldTypeByColumnName(String columnName)
Return the FieldType associated with the columnName.


getIdField

public FieldType getIdField()
Return the id-field associated with the object.


getConstructor

public Constructor<T> getConstructor()

objectToString

public String objectToString(T object)
Return a string representation of the object.


createObject

public T createObject()
               throws SQLException
Create and return an object of this type using our reflection constructor.

Throws:
SQLException

createObject

public static <T,ID> T createObject(Constructor<?> constructor,
                                    Dao<T,ID> dao)
                      throws SQLException
Create and return an object of this type using our reflection constructor.

Throws:
SQLException

isUpdatable

public boolean isUpdatable()
Return true if we can update this object via its ID.



Copyright © 2011. All Rights Reserved.