Package org.apache.torque.map
Klasse TableMap
java.lang.Object
org.apache.torque.map.OptionSupport
org.apache.torque.map.TableMap
- Alle implementierten Schnittstellen:
Serializable
TableMap is used to model a table in a database.
- Version:
- $Id: TableMap.java 1917245 2024-04-21 14:06:23Z tv $
- Autor:
- John D. McNally, Daniel Rall, Greg Monroe
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungTableMap
(String tableName, String prefix, DatabaseMap containingDB) Constructor.TableMap
(String tableName, DatabaseMap containingDB) Constructor. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Add a pre-created column to this table.void
addForeignKey
(ForeignKeyMap foreignKey) Add a foreign key to this table.boolean
containsColumn
(String name) Does this table contain the specified column?boolean
containsColumn
(ColumnMap column) Does this table contain the specified column?boolean
Returns true if this tableMap contains a column with object data.Get a ColumnMap for the named table.Get a ColumnMap[] of the columns in this table.Get the DatabaseMap containing this TableMap.getDbMap()
Returns the database map for this table.Returns the table description info.Get all foreign keys in the table..Returns the fully qualified table name, if available.Get the Java name of the table as defined in XML.Class<?>
Returns the manager class for this table.getName()
Get the name of the Table, not prefixed by a possible schema nameClass<?>
Returns the OM class for this table.Class<?>
Returns the Peer Class for this table.Get table prefix name.Returns the single primary key of this table, if it existsGet the method used to generate primary keys for this table.getPrimaryKeyMethodInfo
(IDMethod idMethod) Get the information used to generate a primary keyGet the schema to which the table belongs to.boolean
Returns whether this table uses inheritance.boolean
Returns whether managers are used for this table.final 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
setPeerClass
(Class<?> peerClass) Sets the Peer class for this table.void
Set table prefix name.void
setPrimaryKeyMethod
(IDMethod method) Sets the method used to generate a key for this table.void
setPrimaryKeyMethodInfo
(Object pkInfo) Sets the pk information needed to generate a key.void
setPrimaryKeyMethodInfo
(IDMethod idMethod, 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.toString()
Von Klasse geerbte Methoden org.apache.torque.map.OptionSupport
clearOptions, getOption, getOptions, setOption
-
Konstruktordetails
-
TableMap
Constructor.- Parameter:
tableName
- The name of the table, may be prefixed with a schema name, not null.containingDB
- A DatabaseMap that this table belongs to.
-
TableMap
Constructor.- Parameter:
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.
-
-
Methodendetails
-
containsColumn
Does this table contain the specified column?- Parameter:
column
- A ColumnMap.- Gibt zurück:
- True if the table contains the column.
-
containsColumn
Does this table contain the specified column?- Parameter:
name
- A String with the name of the column.- Gibt zurück:
- True if the table contains the column.
-
getDatabaseMap
Get the DatabaseMap containing this TableMap.- Gibt zurück:
- A DatabaseMap.
-
containsObjectColumn
public boolean containsObjectColumn()Returns true if this tableMap contains a column with object data. If the type of the column is not a string, a number or a date, it is assumed that it is object data.- Gibt zurück:
- True if map contains a column with object data.
-
getName
Get the name of the Table, not prefixed by a possible schema name- Gibt zurück:
- A String with the name of the table, not null.
-
getSchemaName
Get the schema to which the table belongs to.- Gibt zurück:
- the schema name, or null if the default schema should be used.
-
getFullyQualifiedTableName
Returns the fully qualified table name, if available.- Gibt zurück:
- the fully qualified table name, if a schema is set, or just the table name if no schema is set, not null.
-
getJavaName
Get the Java name of the table as defined in XML.- Gibt zurück:
- A String with the Java name of the table.
-
setJavaName
Set the Java name of the table as defined by generator/XML.- Parameter:
value
- A String with the Java name of the table.
-
getPrefix
Get table prefix name.- Gibt zurück:
- A String with the prefix.
-
setPrefix
Set table prefix name.- Parameter:
prefix
- The prefix for the table name (ie: SCARAB for SCARAB_PROJECT).
-
getPrimaryKeyMethod
Get the method used to generate primary keys for this table.- Gibt zurück:
- A String with the method.
-
getPrimaryKeyMethodInfo
Get the information used to generate a primary key- Parameter:
idMethod
-IDMethod
used to generate a primary key- Gibt zurück:
- An Object.
-
getColumns
Get a ColumnMap[] of the columns in this table.- Gibt zurück:
- A ColumnMap[].
-
getForeignKeys
Get all foreign keys in the table..- Gibt zurück:
- All foreign keys, not null.
-
getColumn
Get a ColumnMap for the named table.- Parameter:
name
- A String with the name of the table.- Gibt zurück:
- A ColumnMap.
-
addColumn
Add a pre-created column to this table. It will replace any existing column.- Parameter:
cmap
- A ColumnMap.
-
addForeignKey
Add a foreign key to this table.- Parameter:
foreignKey
- the foreign key map, not null
-
setPrimaryKeyMethod
Sets the method used to generate a key for this table. Valid values are as specified in theIDMethod
interface.- Parameter:
method
- The ID generation method type, not null.
-
setPrimaryKeyMethodInfo
Sets the pk information needed to generate a key. This overrides all information set bysetPrimaryKeyMethodInfo(String, Object)
.- Parameter:
pkInfo
- information needed to generate a key
-
setPrimaryKeyMethodInfo
Sets the pk information needed to generate a key.- Parameter:
idMethod
- the id method for which this information is stored.pkInfo
- information needed to generate a key.
-
removeUnderScores
Removes the PREFIX, removes the underscores and makes first letter caps. SCARAB_FOO_BAR becomes FooBar.- Parameter:
data
- A String.- Gibt zurück:
- A String with data processed.
-
getDescription
Returns the table description info.- Gibt zurück:
- Returns the description.
-
setDescription
Sets the table description.- Parameter:
description
- The description to set.
-
getOMClass
Returns the OM class for this table.- Gibt zurück:
- the OM class.
-
setOMClass
Sets the OM root class for this table.- Parameter:
omClass
- The OM root class for this table.
-
getPeerClass
Returns the Peer Class for this table.- Gibt zurück:
- The peerClass for this table.
-
setPeerClass
Sets the Peer class for this table.- Parameter:
peerClass
- The peerClass to set.
-
getDbMap
Returns the database map for this table.- Gibt zurück:
- the database map for this table.
-
isUseInheritance
public boolean isUseInheritance()Returns whether this table uses inheritance.- Gibt zurück:
- whether inheritance is used.
-
setUseInheritance
public void setUseInheritance(boolean useInheritance) Sets whether this table uses inheritance.- Parameter:
useInheritance
- whether this table uses inheritance.
-
isUseManager
public boolean isUseManager()Returns whether managers are used for this table.- Gibt zurück:
- whether managers are used for this table.
-
setUseManager
public void setUseManager(boolean useManager) Sets whether managers are used for this table.- Parameter:
useManager
- whether managers are used for this table.
-
getManagerClass
Returns the manager class for this table.- Gibt zurück:
- the managerClass.
-
setManagerClass
Sets the manager class for this table.- Parameter:
managerClass
- the manager class for this table.
-
getPrimaryKey
Returns the single primary key of this table, if it exists- Gibt zurück:
- the single primary key column.
- Löst aus:
TorqueException
- If the table has no primary key or if the table has multiple primary keys.
-
toString
-