public class EntityTable extends AbstractTable
| Constructor and Description |
|---|
EntityTable(JdbcAdaptor jdbcAdaptor,
EntityTypeDescriptor entity,
TableMetadata metadata) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(AbstractColumn column)
Adds the column to the table
|
boolean |
addIndex(String name,
BasicColumn... columns)
Adds the index to table.
|
EntityTypeDescriptor |
getEntity()
Returns the entity of the EntityTable.
|
HashMap<AbstractColumn,String> |
getIdFields()
Returns the id fields of the table.
|
Map<String,BasicColumn[]> |
getIndexes()
Returns the indexes of the table.
|
protected JdbcAdaptor |
getJdbcAdaptor()
Returns the jdbcAdaptor of the EntityTable.
|
Set<String> |
getPkColumnNames()
Returns the set of primary key column names.
|
Collection<AbstractColumn> |
getPkColumns()
Returns the pkColumns of the EntityTable.
|
void |
performInsert(Connection connection,
EntityTypeDescriptor entityType,
Object[] instances,
int size)
Performs inserts to the table for the managed instance or joins.
|
void |
performRemove(Connection connection,
Object[] instances,
int size)
Performs removes from the table for the managed instance or joins.
|
void |
performUpdate(Connection connection,
EntityTypeDescriptor type,
Object instance,
Object oldVersion)
Performs update to the table for the managed instance or joins.
|
boolean |
performUpdateWithUpdatability(Connection connection,
EntityTypeDescriptor type,
Object instance,
Object oldVersion)
Performs update to the table for the managed instance or joins.
|
void |
performVersionUpdate(Connection connection,
Object instance,
Object oldVersion,
Object newVersion)
Performs version update to the table.
|
String |
toString() |
addForeignKey, getCatalog, getColumnMap, getColumnNames, getColumns, getForeignKeys, getInsertColumns, getInsertSql, getLocator, getName, getQName, getRestrictionColumns, getRestrictionSql, getSchema, getSelectVersionColumns, getSelectVersionSql, getUniqueConstraints, getUpdateColumns, getUpdateSql, getVersionUpdateSql, setNamepublic EntityTable(JdbcAdaptor jdbcAdaptor, EntityTypeDescriptor entity, TableMetadata metadata)
jdbcAdaptor - the jdbc adaptorentity - the entitymetadata - the table metadatapublic void addColumn(AbstractColumn column)
addColumn in class AbstractTablecolumn - the column to addpublic boolean addIndex(String name, BasicColumn... columns)
name - the name of the indexcolumns - the columnsname already existed, false otherwisepublic EntityTypeDescriptor getEntity()
public HashMap<AbstractColumn,String> getIdFields()
public Map<String,BasicColumn[]> getIndexes()
protected JdbcAdaptor getJdbcAdaptor()
public Set<String> getPkColumnNames()
getPkColumnNames in class AbstractTablepublic Collection<AbstractColumn> getPkColumns()
public void performInsert(Connection connection, EntityTypeDescriptor entityType, Object[] instances, int size) throws SQLException
connection - the connection to useentityType - the entity type of the instancesinstances - the instances to perform insert forsize - the size of the batchSQLException - thrown in case of underlying SQLExceptionpublic void performRemove(Connection connection, Object[] instances, int size) throws SQLException
connection - the connection to useinstances - the instances to perform remove forsize - the size of the batchSQLException - thrown in case of underlying SQLExceptionpublic void performUpdate(Connection connection, EntityTypeDescriptor type, Object instance, Object oldVersion) throws SQLException
connection - the connection to usetype - the entity type of the instanceinstance - the instance to perform update foroldVersion - the old version valueSQLException - thrown in case of underlying SQLExceptionpublic boolean performUpdateWithUpdatability(Connection connection, EntityTypeDescriptor type, Object instance, Object oldVersion) throws SQLException
connection - the connection to usetype - the entity type of the instanceinstance - the instance to perform update foroldVersion - the old version valueSQLException - thrown in case of underlying SQLExceptionpublic void performVersionUpdate(Connection connection, Object instance, Object oldVersion, Object newVersion) throws SQLException
connection - the connection to useinstance - the instance to perform version update foroldVersion - the old version valuenewVersion - the new version valueSQLException - thrown in case of underlying SQLExceptionCopyright © 2012-2013 Batoo. All Rights Reserved.