|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.map.TableMap
public class TableMap
TableMap is used to model a table in a database.
Constructor Summary | |
---|---|
TableMap(String tableName,
DatabaseMap containingDB)
Constructor. |
|
TableMap(String tableName,
String prefix,
DatabaseMap containingDB)
Constructor. |
Method Summary | |
---|---|
void |
addColumn(ColumnMap cmap)
Add a pre-created column to this table. |
void |
addForeignKey(ForeignKeyMap foreignKey)
Add a foreign key to this table. |
boolean |
containsColumn(ColumnMap column)
Does this table contain the specified column? |
boolean |
containsColumn(String name)
Does this table contain the specified column? |
boolean |
containsObjectColumn()
Returns true if this tableMap contains a column with object data. |
ColumnMap |
getColumn(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. |
String |
getDescription()
Returns the table description info. |
List<ForeignKeyMap> |
getForeignKeys()
Get all foreign keys in the table.. |
String |
getFullyQualifiedTableName()
Returns the fully qualified table name, if available. |
String |
getJavaName()
Get the Java name of the table as defined in XML. |
Class<?> |
getManagerClass()
Returns the manager class for this table. |
String |
getName()
Get the name of the Table, not prefixed by a possible schema name |
Class<?> |
getOMClass()
Returns the OM class for this table. |
String |
getOption(String key)
Returns the value of an option. |
Map<String,String> |
getOptions()
Returns an unmodifiable map of all options. |
Class<?> |
getPeerClass()
Returns the Peer Class for this table. |
String |
getPrefix()
Get table prefix name. |
ColumnMap |
getPrimaryKey()
Returns the single primary key of this table, if it exists |
IDMethod |
getPrimaryKeyMethod()
Get the method used to generate primary keys for this table. |
Object |
getPrimaryKeyMethodInfo(IDMethod idMethod)
Get the information used to generate a primary key |
String |
getSchemaName()
Get the schema to which the table belongs to. |
boolean |
isUseInheritance()
Returns whether this table uses inheritance. |
boolean |
isUseManager()
Returns whether managers are used for this table. |
String |
removeUnderScores(String data)
Removes the PREFIX, removes the underscores and makes first letter caps. |
void |
setDescription(String description)
Sets the table description. |
void |
setJavaName(String value)
Set the Java name of the table as defined by generator/XML. |
void |
setManagerClass(Class<?> managerClass)
Sets the manager class for this table. |
void |
setOMClass(Class<?> omClass)
Sets the OM root class for this table. |
void |
setOption(String key,
String value)
Sets an option. |
void |
setPeerClass(Class<?> peerClass)
Sets the Peer class for this table. |
void |
setPrefix(String prefix)
Set table prefix name. |
void |
setPrimaryKeyMethod(IDMethod method)
Sets the method used to generate a key for this table. |
void |
setPrimaryKeyMethodInfo(IDMethod idMethod,
Object pkInfo)
Sets the pk information needed to generate a key. |
void |
setPrimaryKeyMethodInfo(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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableMap(String tableName, DatabaseMap containingDB)
tableName
- The name of the table, may be prefixed with a
schema name, not null.containingDB
- A DatabaseMap that this table belongs to.public TableMap(String tableName, String prefix, DatabaseMap containingDB)
tableName
- The name of the table, may be prefixed with a
schema name, not null.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(String name)
name
- A String with the name of the column.
public DatabaseMap getDatabaseMap()
public boolean containsObjectColumn()
public String getName()
public String getSchemaName()
public String getFullyQualifiedTableName()
public String getJavaName()
public void setJavaName(String value)
value
- A String with the Java name of the table.public String getPrefix()
public void setPrefix(String prefix)
prefix
- The prefix for the table name (ie: SCARAB for
SCARAB_PROJECT).public IDMethod getPrimaryKeyMethod()
public Object getPrimaryKeyMethodInfo(IDMethod idMethod)
public ColumnMap[] getColumns()
public List<ForeignKeyMap> getForeignKeys()
public ColumnMap getColumn(String name)
name
- A String with the name of the table.
public void addColumn(ColumnMap cmap)
cmap
- A ColumnMap.public void addForeignKey(ForeignKeyMap foreignKey)
foreignKey
- the foreign key map, not nullpublic void setPrimaryKeyMethod(IDMethod method)
IDMethod
interface.
method
- The ID generation method type, not null.public void setPrimaryKeyMethodInfo(Object pkInfo)
setPrimaryKeyMethodInfo(String, Object)
.
pkInfo
- information needed to generate a keypublic void setPrimaryKeyMethodInfo(IDMethod idMethod, Object pkInfo)
idMethod
- the id method for which this information is stored.pkInfo
- information needed to generate a key.public final String removeUnderScores(String data)
data
- A String.
public String getDescription()
public void setDescription(String description)
description
- The description to set.public Class<?> getOMClass()
public void setOMClass(Class<?> omClass)
omClass
- The OM root class for this table.public Class<?> getPeerClass()
public void setPeerClass(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 Class<?> getManagerClass()
public void setManagerClass(Class<?> managerClass)
managerClass
- the manager class for this table.public Map<String,String> getOptions()
public void setOption(String key, String value)
key
- the key of the optionvalue
- the value of the option.public String getOption(String key)
key
- the key of the option.
public ColumnMap getPrimaryKey() throws TorqueException
TorqueException
- If the table has no primary key
or if the table has multiple primary keys.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |