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

java.lang.Object
  |
  +--org.apache.turbine.torque.engine.database.model.Database

public class Database
extends java.lang.Object

A class for holding application data structures.

Version:
$Id$
Author:
John McNally,
Field Summary
private  java.lang.String baseClass
           
private  java.lang.String basePeer
           
private  Column curColumn
           
private  AppData dbParent
           
private  java.lang.String defaultIdMethod
           
private  java.lang.String name
           
private  java.lang.String pkg
           
private  java.util.List tableList
           
private  java.util.Hashtable tablesByJavaName
           
private  java.util.Hashtable tablesByName
           
 
Constructor Summary
Database()
          Default Constructor
 
Method Summary
 Table addTable(org.xml.sax.Attributes attrib)
          An utility method to add a new table from an xml attribute.
 void addTable(Table tbl)
          Add a table to the vector and sets the Database property to this Database
 AppData getAppData()
          Get the parent of the table
 java.lang.String getBaseClass()
          Get the value of baseClass.
 java.lang.String getBasePeer()
          Get the value of basePeer.
 java.lang.String getDefaultIdMethod()
          Get the value of defaultIdMethod.
 java.lang.String getName()
          Get the name of the Database
 java.lang.String getPackage()
          Get the value of package.
 Table getTable(java.lang.String name)
          Return the table with the specified name.
 Table getTableByJavaName(java.lang.String javaName)
          Return the table with the specified javaName.
 Table[] getTables()
          Return an array of all tables
 void loadFromXML(org.xml.sax.Attributes attrib)
          Load the database object from an xml tag.
 void setAppData(AppData parent)
          Set the parent of the database
 void setBaseClass(java.lang.String v)
          Set the value of baseClass.
 void setBasePeer(java.lang.String v)
          Set the value of basePeer.
 void setDefaultIdMethod(java.lang.String v)
          Set the value of defaultIdMethod.
 void setName(java.lang.String newName)
          Set the name of the Database
 void setPackage(java.lang.String v)
          Set the value of package.
 java.lang.String toString()
          Creats a string representation of this Database.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

tableList

private java.util.List tableList

curColumn

private Column curColumn

name

private java.lang.String name

pkg

private java.lang.String pkg

baseClass

private java.lang.String baseClass

basePeer

private java.lang.String basePeer

defaultIdMethod

private java.lang.String defaultIdMethod

dbParent

private AppData dbParent

tablesByName

private java.util.Hashtable tablesByName

tablesByJavaName

private java.util.Hashtable tablesByJavaName
Constructor Detail

Database

public Database()
Default Constructor
Method Detail

loadFromXML

public void loadFromXML(org.xml.sax.Attributes attrib)
Load the database object from an xml tag.

getName

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

setName

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

getPackage

public java.lang.String getPackage()
Get the value of package.
Returns:
value of package.

setPackage

public void setPackage(java.lang.String v)
Set the value of package.
Parameters:
v - Value to assign to package.

getBaseClass

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

setBaseClass

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

getBasePeer

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

setBasePeer

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

getDefaultIdMethod

public java.lang.String getDefaultIdMethod()
Get the value of defaultIdMethod.
Returns:
value of defaultIdMethod.

setDefaultIdMethod

public void setDefaultIdMethod(java.lang.String v)
Set the value of defaultIdMethod.
Parameters:
v - Value to assign to defaultIdMethod.

getTables

public Table[] getTables()
Return an array of all tables

getTable

public Table getTable(java.lang.String name)
Return the table with the specified name.
Returns:
A Table object. If it does not exist it returns null

getTableByJavaName

public Table getTableByJavaName(java.lang.String javaName)
Return the table with the specified javaName.
Returns:
A Table object. If it does not exist it returns null

addTable

public Table addTable(org.xml.sax.Attributes attrib)
An utility method to add a new table from an xml attribute.

addTable

public void addTable(Table tbl)
Add a table to the vector and sets the Database property to this Database

setAppData

public void setAppData(AppData parent)
Set the parent of the database

getAppData

public AppData getAppData()
Get the parent of the table

toString

public java.lang.String toString()
Creats a string representation of this Database. The representation is given in xml format.
Overrides:
toString in class java.lang.Object


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.