|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.map.TableMap
public class TableMap
TableMap is used to model a table in a database.
Field Summary | |
---|---|
protected static java.lang.String[] |
VALID_ID_METHODS
The list of valid ID generation methods. |
Fields inherited from interface org.apache.torque.adapter.IDMethod |
---|
AUTO_INCREMENT, ID_BROKER, NATIVE, NO_ID_METHOD, SEQUENCE |
Constructor Summary | |
---|---|
TableMap()
Required by proxy. |
|
TableMap(java.lang.String tableName,
DatabaseMap containingDB)
Constructor. |
|
TableMap(java.lang.String tableName,
int numberOfColumns,
DatabaseMap containingDB)
Constructor. |
|
TableMap(java.lang.String tableName,
java.lang.String prefix,
DatabaseMap containingDB)
Constructor. |
Method Summary | |
---|---|
void |
addColumn(ColumnMap cmap)
Add a pre-created column to this table. |
void |
addColumn(java.lang.String columnName,
java.lang.Object type)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addColumn(java.lang.String columnName,
java.lang.Object type,
int size)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addColumn(java.lang.String columnName,
java.lang.Object type,
int size,
int scale)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addForeignKey(java.lang.String columnName,
java.lang.Object type,
java.lang.String fkTable,
java.lang.String fkColumn)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addForeignKey(java.lang.String columnName,
java.lang.Object type,
java.lang.String fkTable,
java.lang.String fkColumn,
int size)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addForeignPrimaryKey(java.lang.String columnName,
java.lang.Object type,
java.lang.String fkTable,
java.lang.String fkColumn)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addForeignPrimaryKey(java.lang.String columnName,
java.lang.Object type,
java.lang.String fkTable,
java.lang.String fkColumn,
int size)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addPrimaryKey(java.lang.String columnName,
java.lang.Object type)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
void |
addPrimaryKey(java.lang.String columnName,
java.lang.Object type,
int size)
Deprecated. Associated Column maps should be populated using it's set methods, then added to table via addColumn(ColumnMap). This method will be removed in a future version of Torque. |
boolean |
containsColumn(ColumnMap column)
Does this table contain the specified column? |
boolean |
containsColumn(java.lang.String name)
Does this table contain the specified column? |
boolean |
containsObjectColumn()
Returns true if this tableMap contains a column with object data. |
ColumnMap |
getColumn(java.lang.String name)
Get a ColumnMap for the named table. |
ColumnMap[] |
getColumns()
Get a ColumnMap[] of the columns in this table. |
DatabaseMap |
getDatabaseMap()
Get the DatabaseMap containing this TableMap. |
DatabaseMap |
getDbMap()
Returns the database map for this table. |
java.lang.String |
getDescription()
Returns the table description info. |
IdGenerator |
getIdGenerator()
Deprecated. use DatabaseInfo.getIdGenerator(getPrimaryKeyMethod()) instead. Will be removed in a future version of Torque. |
java.lang.String |
getJavaName()
Get the Java name of the table as defined in XML. |
java.lang.Class |
getManagerClass()
Returns the manager class for this table. |
java.lang.String |
getName()
Get the name of the Table. |
java.lang.Class |
getOMClass()
Returns the OM class for this table. |
java.lang.Class |
getPeerClass()
Returns the Peer Class for this table. |
java.lang.String |
getPrefix()
Get table prefix name. |
java.lang.String |
getPrimaryKeyMethod()
Get the method used to generate primary keys for this table. |
java.lang.Object |
getPrimaryKeyMethodInfo()
Get the information used to generate a primary key |
boolean |
isUseInheritance()
Returns whether this table uses inheritance. |
boolean |
isUseManager()
Returns whether managers are used for this table. |
java.lang.String |
removeUnderScores(java.lang.String data)
Removes the PREFIX, removes the underscores and makes first letter caps. |
void |
setDescription(java.lang.String description)
Sets the table description. |
void |
setJavaName(java.lang.String value)
Set the Java name of the table as defined by generator/XML. |
void |
setManagerClass(java.lang.Class managerClass)
Sets the manager class for this table. |
void |
setOMClass(java.lang.Class omClass)
Sets the OM root class for this table. |
void |
setPeerClass(java.lang.Class peerClass)
Sets the Peer class for this table. |
void |
setPrefix(java.lang.String prefix)
Set table prefix name. |
void |
setPrimaryKeyMethod(java.lang.String method)
Sets the method used to generate a key for this table. |
void |
setPrimaryKeyMethodInfo(java.lang.Object pkInfo)
Sets the pk information needed to generate a key |
void |
setUseInheritance(boolean useInheritance)
Sets whether this table uses inheritance. |
void |
setUseManager(boolean useManager)
Sets whether managers are used for this table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String[] VALID_ID_METHODS
Constructor Detail |
---|
public TableMap()
public TableMap(java.lang.String tableName, int numberOfColumns, DatabaseMap containingDB)
tableName
- The name of the table.numberOfColumns
- The number of columns in the table.containingDB
- A DatabaseMap that this table belongs to.public TableMap(java.lang.String tableName, DatabaseMap containingDB)
tableName
- The name of the table.containingDB
- A DatabaseMap that this table belongs to.public TableMap(java.lang.String tableName, java.lang.String prefix, DatabaseMap containingDB)
tableName
- The name of the table.prefix
- The prefix for the table name (ie: SCARAB for
SCARAB_PROJECT).containingDB
- A DatabaseMap that this table belongs to.Method Detail |
---|
public boolean containsColumn(ColumnMap column)
column
- A ColumnMap.
public boolean containsColumn(java.lang.String name)
name
- A String with the name of the column.
public DatabaseMap getDatabaseMap()
public boolean containsObjectColumn()
public java.lang.String getName()
public java.lang.String getJavaName()
public void setJavaName(java.lang.String value)
value
- A String with the Java name of the table.public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix
- The prefix for the table name (ie: SCARAB for
SCARAB_PROJECT).public java.lang.String getPrimaryKeyMethod()
public IdGenerator getIdGenerator()
public java.lang.Object getPrimaryKeyMethodInfo()
public ColumnMap[] getColumns()
public ColumnMap getColumn(java.lang.String name)
name
- A String with the name of the table.
public void addColumn(ColumnMap cmap)
cmap
- A ColumnMap.public void addColumn(java.lang.String columnName, java.lang.Object type)
columnName
- A String with the column name.type
- An Object specifying the type.public void addColumn(java.lang.String columnName, java.lang.Object type, int size, int scale)
columnName
- A String with the column name.type
- An Object specifying the type.size
- An int specifying the size.scale
- An int specifying the scale.public void addColumn(java.lang.String columnName, java.lang.Object type, int size)
columnName
- A String with the column name.type
- An Object specifying the type.size
- An int specifying the size.public void addPrimaryKey(java.lang.String columnName, java.lang.Object type)
columnName
- A String with the column name.type
- An Object specifying the type.public void addPrimaryKey(java.lang.String columnName, java.lang.Object type, int size)
columnName
- A String with the column name.type
- An Object specifying the type.size
- An int specifying the size.public void addForeignKey(java.lang.String columnName, java.lang.Object type, java.lang.String fkTable, java.lang.String fkColumn)
columnName
- A String with the column name.type
- An Object specifying the type.fkTable
- A String with the foreign key table name.fkColumn
- A String with the foreign key column name.public void addForeignKey(java.lang.String columnName, java.lang.Object type, java.lang.String fkTable, java.lang.String fkColumn, int size)
columnName
- A String with the column name.type
- An Object specifying the type.fkTable
- A String with the foreign key table name.fkColumn
- A String with the foreign key column name.size
- An int specifying the size.public void addForeignPrimaryKey(java.lang.String columnName, java.lang.Object type, java.lang.String fkTable, java.lang.String fkColumn)
columnName
- A String with the column name.type
- An Object specifying the type.fkTable
- A String with the foreign key table name.fkColumn
- A String with the foreign key column name.public void addForeignPrimaryKey(java.lang.String columnName, java.lang.Object type, java.lang.String fkTable, java.lang.String fkColumn, int size)
columnName
- A String with the column name.type
- An Object specifying the type.fkTable
- A String with the foreign key table name.fkColumn
- A String with the foreign key column name.size
- An int specifying the size.public void setPrimaryKeyMethod(java.lang.String method)
IDMethod
interface.
method
- The ID generation method type name.public void setPrimaryKeyMethodInfo(java.lang.Object pkInfo)
pkInfo
- information needed to generate a keypublic final java.lang.String removeUnderScores(java.lang.String data)
data
- A String.
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- The description to set.public java.lang.Class getOMClass()
public void setOMClass(java.lang.Class omClass)
omClass
- The OM root class for this table.public java.lang.Class getPeerClass()
public void setPeerClass(java.lang.Class peerClass)
peerClass
- The peerClass to set.public DatabaseMap getDbMap()
public boolean isUseInheritance()
public void setUseInheritance(boolean useInheritance)
useInheritance
- whether this table uses inheritance.public boolean isUseManager()
public void setUseManager(boolean useManager)
useManager
- whether managers are used for this table.public java.lang.Class getManagerClass()
public void setManagerClass(java.lang.Class managerClass)
managerClass
- the manager class for this table.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |