org.apache.turbine.torque.engine.database.model
Class Table

java.lang.Object
  |
  +--org.apache.turbine.torque.engine.database.model.Table
All Implemented Interfaces:
IDMethod

Deprecated. use turbine-torque

public class Table
extends java.lang.Object
implements IDMethod

Data about a table used in an application.

Version:
$Id: Table.java,v 1.6 2002/02/26 22:15:43 fedor Exp $
Author:
Leon Messerschmidt, Jason van Zyl, Martin Poeschl, John McNally, Daniel Rall

Field Summary
private  boolean abstractValue
          Deprecated.  
private  java.lang.String alias
          Deprecated.  
private  java.lang.String baseClass
          Deprecated.  
private  java.lang.String basePeer
          Deprecated.  
private  java.util.List columnList
          Deprecated.  
private  java.util.Hashtable columnsByJavaName
          Deprecated.  
private  java.util.Hashtable columnsByName
          Deprecated.  
private  boolean containsForeignPK
          Deprecated.  
private  java.util.List foreignKeys
          Deprecated.  
private  java.util.List foreignTableNames
          Deprecated.  
private  java.lang.String idMethod
          Deprecated.  
private  java.util.List idMethodParameters
          Deprecated.  
private  java.util.List indices
          Deprecated.  
private  Column inheritanceColumn
          Deprecated.  
private  java.lang.String javaName
          Deprecated.  
private  java.lang.String name
          Deprecated.  
private  java.util.List referrers
          Deprecated.  
private  boolean skipSql
          Deprecated.  
private  Database tableParent
          Deprecated.  
private  java.util.List unices
          Deprecated.  
 
Fields inherited from interface org.apache.turbine.util.db.map.IDMethod
AUTO_INCREMENT, AUTOINCREMENT, ID_BROKER, IDBROKERTABLE, NATIVE, NO_ID_METHOD, SEQUENCE
 
Constructor Summary
Table()
          Deprecated. Default Constructor
Table(java.lang.String name)
          Deprecated. Constructs a table object with a name
 
Method Summary
 Column addColumn(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new column from attrib and add it to this table.
 void addColumn(Column col)
          Deprecated. Adds a new column to the column vector and set the parent table of the column to the current table
 ForeignKey addForeignKey(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new foreign key from attrib and add it to this table.
 void addForeignKey(ForeignKey fk)
          Deprecated. Adds a new FK to the FK vector and set the parent table of the column to the current table
 IdMethodParameter addIdMethodParameter(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new id method parameter from attrib and add it to this table.
 void addIdMethodParameter(IdMethodParameter imp)
          Deprecated. Adds a new ID method parameter to the list and sets the parent table of the column associated with the supplied parameter to this table.
 Index addIndex(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new index from attrib and add it to this table.
 void addIndex(Index index)
          Deprecated. Adds a new index to the index vector and set the parent table of the column to the current table
 void addReferrer(ForeignKey fk)
          Deprecated. Adds the foreign key from another table that refers to this table.
 Unique addUnique(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new Unique from attrib and add it to this table.
 void addUnique(Unique unique)
          Deprecated. Adds a new Unique to the Unique vector and set the parent table of the column to the current table
 boolean containsColumn(Column col)
          Deprecated. Returns true if the table contains a spesified column
 boolean containsColumn(java.lang.String name)
          Deprecated. Returns true if the table contains a spesified column
 java.util.List getAdditionalIndicesForPrimaryKey()
          Deprecated. Returns a list of CSV strings for a primary key composed of multiple parts to create extra indices for.
 java.lang.String getAlias()
          Deprecated. JavaName of om object this entry references.
 java.lang.String getBaseClass()
          Deprecated. Get the value of baseClass.
 java.lang.String getBasePeer()
          Deprecated. Get the value of basePeer.
 Column getChildrenColumn()
          Deprecated.  
 java.util.List getChildrenNames()
          Deprecated. Get the objects that can be created from this table.
 Column getColumn(java.lang.String name)
          Deprecated. Returns a specified column.
 Column getColumnByJavaName(java.lang.String javaName)
          Deprecated. Returns a specified column.
 Column[] getColumns()
          Deprecated. Returns an Array containing all the columns in the table
 boolean getContainsForeignPK()
          Deprecated. Determine if this table contains a foreign PK
 Database getDatabase()
          Deprecated. Get the parent of the table
 ForeignKey getForeignKey(java.lang.String col)
          Deprecated. Return the first foreign key that includes col in it's list of local columns.
 ForeignKey[] getForeignKeys()
          Deprecated. Returns an Array containing all the FKs in the table
 java.util.List getForeignTableNames()
          Deprecated. A list of tables referenced by foreign keys in this table
 java.lang.String getIdMethod()
          Deprecated. Get the method for generating pk's
 java.util.List getIdMethodParameters()
          Deprecated. Returns a Collection of parameters relevant for the chosen id generation method.
 Index[] getIndices()
          Deprecated. Returns an Array containing all the FKs in the table
 java.lang.String getJavaName()
          Deprecated. Get name to use in Java sources
 java.lang.String getName()
          Deprecated. Get the name of the Table
 int getNumColumns()
          Deprecated. Utility method to get the number of columns in this table
 java.util.List getPrimaryKey()
          Deprecated. Returns the collection of Columns which make up the single primary key for this table.
 java.util.ArrayList getPrimaryKeys()
          Deprecated. Use getPrimaryKey() instead.
 java.util.List getReferrers()
          Deprecated. Get list of references to this table.
 java.lang.String getSequenceName()
          Deprecated. A name to use for creating a sequence if one is not specified.
 Unique[] getUnices()
          Deprecated. Returns an Array containing all the UKs in the table
 boolean hasPrimaryKey()
          Deprecated. Determine whether this table has a primary key.
 boolean isAbstract()
          Deprecated. When a table is abstract, it marks the business object class that is generated as being abstract.
 boolean isAlias()
          Deprecated. Is this table specified in the schema or is there just a foreign key reference to it.
 boolean isSkipSql()
          Deprecated. Skip generating sql for this table (in the event it should not be created from scratch).
 void loadFromXML(org.xml.sax.AttributeList attrib, java.lang.String defaultIdMethod)
          Deprecated. Load the table object from an xml tag.
private  java.lang.String printList(java.util.List list)
          Deprecated. Returns the elements of the list, separated by commas.
 java.lang.String printPrimaryKey()
          Deprecated. Returns all parts of the primary key, separated by commas.
 java.lang.String printPrimaryKeys()
          Deprecated. Use printPrimaryKey() instead.
 void setAbstract(boolean v)
          Deprecated. When a table is abstract, it marks the business object class that is generated as being abstract.
 void setAlias(java.lang.String v)
          Deprecated. Set whether this table specified in the schema or is there just a foreign key reference to it.
 void setBaseClass(java.lang.String v)
          Deprecated. Set the value of baseClass.
 void setBasePeer(java.lang.String v)
          Deprecated. Set the value of basePeer.
 void setContainsForeignPK(boolean b)
          Deprecated. Set whether this table contains a foreign PK
 void setDatabase(Database parent)
          Deprecated. Set the parent of the table
 void setIdMethod(java.lang.String idMethod)
          Deprecated. Set the method for generating pk's
 void setJavaName(java.lang.String javaName)
          Deprecated. Set name to use in Java sources
 void setName(java.lang.String newName)
          Deprecated. Set the name of the Table
 void setSkipSql(boolean v)
          Deprecated. Set whether this table should have its creation sql generated.
 java.lang.String toString()
          Deprecated. Returns a XML representation of this table.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

columnList

private java.util.List columnList
Deprecated. 

foreignKeys

private java.util.List foreignKeys
Deprecated. 

indices

private java.util.List indices
Deprecated. 

unices

private java.util.List unices
Deprecated. 

idMethodParameters

private java.util.List idMethodParameters
Deprecated. 

name

private java.lang.String name
Deprecated. 

javaName

private java.lang.String javaName
Deprecated. 

idMethod

private java.lang.String idMethod
Deprecated. 

tableParent

private Database tableParent
Deprecated. 

referrers

private java.util.List referrers
Deprecated. 

foreignTableNames

private java.util.List foreignTableNames
Deprecated. 

containsForeignPK

private boolean containsForeignPK
Deprecated. 

inheritanceColumn

private Column inheritanceColumn
Deprecated. 

skipSql

private boolean skipSql
Deprecated. 

abstractValue

private boolean abstractValue
Deprecated. 

alias

private java.lang.String alias
Deprecated. 

baseClass

private java.lang.String baseClass
Deprecated. 

basePeer

private java.lang.String basePeer
Deprecated. 

columnsByName

private java.util.Hashtable columnsByName
Deprecated. 

columnsByJavaName

private java.util.Hashtable columnsByJavaName
Deprecated. 
Constructor Detail

Table

public Table()
Deprecated. 
Default Constructor

Table

public Table(java.lang.String name)
Deprecated. 
Constructs a table object with a name
Method Detail

loadFromXML

public void loadFromXML(org.xml.sax.AttributeList attrib,
                        java.lang.String defaultIdMethod)
Deprecated. 
Load the table object from an xml tag.

getBaseClass

public java.lang.String getBaseClass()
Deprecated. 
Get the value of baseClass.
Returns:
value of baseClass.

setBaseClass

public void setBaseClass(java.lang.String v)
Deprecated. 
Set the value of baseClass.
Parameters:
v - Value to assign to baseClass.

getBasePeer

public java.lang.String getBasePeer()
Deprecated. 
Get the value of basePeer.
Returns:
value of basePeer.

setBasePeer

public void setBasePeer(java.lang.String v)
Deprecated. 
Set the value of basePeer.
Parameters:
v - Value to assign to basePeer.

addColumn

public Column addColumn(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new column from attrib and add it to this table.

addColumn

public void addColumn(Column col)
Deprecated. 
Adds a new column to the column vector and set the parent table of the column to the current table

addForeignKey

public ForeignKey addForeignKey(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new foreign key from attrib and add it to this table.

getChildrenColumn

public Column getChildrenColumn()
Deprecated. 

getChildrenNames

public java.util.List getChildrenNames()
Deprecated. 
Get the objects that can be created from this table.

addReferrer

public void addReferrer(ForeignKey fk)
Deprecated. 
Adds the foreign key from another table that refers to this table.

getReferrers

public java.util.List getReferrers()
Deprecated. 
Get list of references to this table.

setContainsForeignPK

public void setContainsForeignPK(boolean b)
Deprecated. 
Set whether this table contains a foreign PK

getContainsForeignPK

public boolean getContainsForeignPK()
Deprecated. 
Determine if this table contains a foreign PK

getForeignTableNames

public java.util.List getForeignTableNames()
Deprecated. 
A list of tables referenced by foreign keys in this table

addForeignKey

public void addForeignKey(ForeignKey fk)
Deprecated. 
Adds a new FK to the FK vector and set the parent table of the column to the current table

addIdMethodParameter

public IdMethodParameter addIdMethodParameter(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new id method parameter from attrib and add it to this table.

addIdMethodParameter

public void addIdMethodParameter(IdMethodParameter imp)
Deprecated. 
Adds a new ID method parameter to the list and sets the parent table of the column associated with the supplied parameter to this table.
Parameters:
imp - The column to add as an ID method parameter.

addIndex

public void addIndex(Index index)
Deprecated. 
Adds a new index to the index vector and set the parent table of the column to the current table

addIndex

public Index addIndex(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new index from attrib and add it to this table.

addUnique

public void addUnique(Unique unique)
Deprecated. 
Adds a new Unique to the Unique vector and set the parent table of the column to the current table

addUnique

public Unique addUnique(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new Unique from attrib and add it to this table.

getName

public java.lang.String getName()
Deprecated. 
Get the name of the Table

setName

public void setName(java.lang.String newName)
Deprecated. 
Set the name of the Table

getJavaName

public java.lang.String getJavaName()
Deprecated. 
Get name to use in Java sources

setJavaName

public void setJavaName(java.lang.String javaName)
Deprecated. 
Set name to use in Java sources

getIdMethod

public java.lang.String getIdMethod()
Deprecated. 
Get the method for generating pk's

setIdMethod

public void setIdMethod(java.lang.String idMethod)
Deprecated. 
Set the method for generating pk's

isSkipSql

public boolean isSkipSql()
Deprecated. 
Skip generating sql for this table (in the event it should not be created from scratch).
Returns:
value of skipSql.

setSkipSql

public void setSkipSql(boolean v)
Deprecated. 
Set whether this table should have its creation sql generated.
Parameters:
v - Value to assign to skipSql.

getAlias

public java.lang.String getAlias()
Deprecated. 
JavaName of om object this entry references.
Returns:
value of external.

isAlias

public boolean isAlias()
Deprecated. 
Is this table specified in the schema or is there just a foreign key reference to it.
Returns:
value of external.

setAlias

public void setAlias(java.lang.String v)
Deprecated. 
Set whether this table specified in the schema or is there just a foreign key reference to it.
Parameters:
v - Value to assign to alias.

isAbstract

public boolean isAbstract()
Deprecated. 
When a table is abstract, it marks the business object class that is generated as being abstract. if you have a table called "FOO", then the Foo BO will be public abstract class Foo This helps support class hierarchies
Returns:
value of abstractValue.

setAbstract

public void setAbstract(boolean v)
Deprecated. 
When a table is abstract, it marks the business object class that is generated as being abstract. if you have a table called "FOO", then the Foo BO will be public abstract class Foo This helps support class hierarchies
Parameters:
v - Value to assign to abstractValue.

getColumns

public Column[] getColumns()
Deprecated. 
Returns an Array containing all the columns in the table

getNumColumns

public int getNumColumns()
Deprecated. 
Utility method to get the number of columns in this table

getForeignKeys

public ForeignKey[] getForeignKeys()
Deprecated. 
Returns an Array containing all the FKs in the table

getIdMethodParameters

public java.util.List getIdMethodParameters()
Deprecated. 
Returns a Collection of parameters relevant for the chosen id generation method.

getSequenceName

public java.lang.String getSequenceName()
Deprecated. 
A name to use for creating a sequence if one is not specified.

getIndices

public Index[] getIndices()
Deprecated. 
Returns an Array containing all the FKs in the table

getUnices

public Unique[] getUnices()
Deprecated. 
Returns an Array containing all the UKs in the table

getColumn

public Column getColumn(java.lang.String name)
Deprecated. 
Returns a specified column.
Returns:
Return a Column object or null if it does not exist.

getColumnByJavaName

public Column getColumnByJavaName(java.lang.String javaName)
Deprecated. 
Returns a specified column.
Returns:
Return a Column object or null if it does not exist.

getForeignKey

public ForeignKey getForeignKey(java.lang.String col)
Deprecated. 
Return the first foreign key that includes col in it's list of local columns. Eg. Foreign key (a,b,c) refrences tbl(x,y,z) will be returned of col is either a,b or c.
Returns:
Return a Column object or null if it does not exist.

containsColumn

public boolean containsColumn(Column col)
Deprecated. 
Returns true if the table contains a spesified column

containsColumn

public boolean containsColumn(java.lang.String name)
Deprecated. 
Returns true if the table contains a spesified column

setDatabase

public void setDatabase(Database parent)
Deprecated. 
Set the parent of the table

getDatabase

public Database getDatabase()
Deprecated. 
Get the parent of the table

toString

public java.lang.String toString()
Deprecated. 
Returns a XML representation of this table.
Overrides:
toString in class java.lang.Object

getPrimaryKey

public java.util.List getPrimaryKey()
Deprecated. 
Returns the collection of Columns which make up the single primary key for this table.
Returns:
A list of the primary key parts.

getPrimaryKeys

public final java.util.ArrayList getPrimaryKeys()
Deprecated. Use getPrimaryKey() instead.


hasPrimaryKey

public boolean hasPrimaryKey()
Deprecated. 
Determine whether this table has a primary key.
Returns:
Whether this table has any primary key parts.

printPrimaryKey

public java.lang.String printPrimaryKey()
Deprecated. 
Returns all parts of the primary key, separated by commas.
Returns:
A CSV list of primary key parts.

printPrimaryKeys

public final java.lang.String printPrimaryKeys()
Deprecated. Use printPrimaryKey() instead.


printList

private java.lang.String printList(java.util.List list)
Deprecated. 
Returns the elements of the list, separated by commas.
Returns:
A CSV list.

getAdditionalIndicesForPrimaryKey

public java.util.List getAdditionalIndicesForPrimaryKey()
Deprecated. 
Returns a list of CSV strings for a primary key composed of multiple parts to create extra indices for. In MySQL, values much match key part order from the left to right. So, in the key definition PRIMARY KEY (FOO_ID, BAR_ID), FOO_ID must be the first element used in the where clause of the SQL query used against this table for the primary key index to be used. This feature could cause problems under MySQL with heavily indexed tables, as MySQL currently only supports 16 indices per table (i.e. it might cause too many indices to be created).

See the manual for a better description of this issue.

Returns:
A list of CSV list of primary key parts.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.