org.apache.torque.map
Class DatabaseMap

java.lang.Object
  extended byorg.apache.torque.map.DatabaseMap
All Implemented Interfaces:
java.io.Serializable

public class DatabaseMap
extends java.lang.Object
implements java.io.Serializable

DatabaseMap is used to model a database.

Version:
$Id: DatabaseMap.java,v 1.7.4.2 2004/05/20 04:36:07 seade Exp $
Author:
John D. McNally, Daniel Rall
See Also:
Serialized Form

Constructor Summary
DatabaseMap()
          Required by proxy.
DatabaseMap(java.lang.String name)
          Constructor.
DatabaseMap(java.lang.String name, int numberOfTables)
          Constructor.
 
Method Summary
 void addIdGenerator(java.lang.String type, IdGenerator idGen)
          Add a type of id generator for access by a TableMap.
 void addTable(java.lang.String tableName)
          Add a new table to the database by name.
 void addTable(java.lang.String tableName, int numberOfColumns)
          Add a new table to the database by name.
 void addTable(TableMap map)
          Add a new TableMap to the database.
 boolean containsTable(java.lang.String name)
          Does this database contain this specific table?
 boolean containsTable(TableMap table)
          Does this database contain this specific table?
 IDBroker getIDBroker()
          Get the IDBroker for this database.
 TableMap getIdTable()
          Get the ID table for this database.
 java.lang.String getName()
          Get the name of this database.
 TableMap getTable(java.lang.String name)
          Get a TableMap for the table by name.
 TableMap[] getTables()
          Get a TableMap[] of all of the tables in the database.
 void setIdTable(java.lang.String tableName)
          Set the ID table for this database.
 void setIdTable(TableMap idTable)
          Set the ID table for this database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseMap

public DatabaseMap()
Required by proxy. Not used.


DatabaseMap

public DatabaseMap(java.lang.String name,
                   int numberOfTables)
Constructor.

Parameters:
name - Name of the database.
numberOfTables - Number of tables in the database.

DatabaseMap

public DatabaseMap(java.lang.String name)
Constructor.

Parameters:
name - Name of the database.
Method Detail

containsTable

public boolean containsTable(TableMap table)
Does this database contain this specific table?

Parameters:
table - The TableMap representation of the table.
Returns:
True if the database contains the table.

containsTable

public boolean containsTable(java.lang.String name)
Does this database contain this specific table?

Parameters:
name - The String representation of the table.
Returns:
True if the database contains the table.

getIdTable

public TableMap getIdTable()
Get the ID table for this database.

Returns:
A TableMap.

getIDBroker

public IDBroker getIDBroker()
Get the IDBroker for this database.

Returns:
An IDBroker.

getName

public java.lang.String getName()
Get the name of this database.

Returns:
A String.

getTable

public TableMap getTable(java.lang.String name)
Get a TableMap for the table by name.

Parameters:
name - Name of the table.
Returns:
A TableMap, null if the table was not found.

getTables

public TableMap[] getTables()
Get a TableMap[] of all of the tables in the database.

Returns:
A TableMap[].

addTable

public void addTable(java.lang.String tableName)
Add a new table to the database by name. It creates an empty TableMap that you need to populate.

Parameters:
tableName - The name of the table.

addTable

public void addTable(java.lang.String tableName,
                     int numberOfColumns)
Add a new table to the database by name. It creates an empty TableMap that you need to populate.

Parameters:
tableName - The name of the table.
numberOfColumns - The number of columns in the table.

addTable

public void addTable(TableMap map)
Add a new TableMap to the database.

Parameters:
map - The TableMap representation.

setIdTable

public void setIdTable(TableMap idTable)
Set the ID table for this database.

Parameters:
idTable - The TableMap representation for the ID table.

setIdTable

public void setIdTable(java.lang.String tableName)
Set the ID table for this database.

Parameters:
tableName - The name for the ID table.

addIdGenerator

public void addIdGenerator(java.lang.String type,
                           IdGenerator idGen)
Add a type of id generator for access by a TableMap.

Parameters:
type - a String value
idGen - an IdGenerator value


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