|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.engine.database.model.Database
public class Database
A class for holding application data structures.
Constructor Summary | |
---|---|
Database(String databaseType)
Creates a new instance for the specified database type. |
Method Summary | |
---|---|
void |
addDomain(Domain domain)
|
void |
addOption(String key,
String value)
Add an XML Specified option key/value pair to this element's option set. |
Table |
addTable(Attributes attrib)
An utility method to add a new table from an xml attribute. |
void |
addTable(Table tbl)
Add a table to the list and sets the Database property to this Database |
void |
doFinalInitialization()
Initializes the model. |
String |
getBaseClass()
Get the value of baseClass. |
String |
getBasePeer()
Get the value of basePeer. |
protected String |
getDatabaseType()
|
String |
getDefaultIdMethod()
Get the value of defaultIdMethod. |
String |
getDefaultJavaNamingMethod()
Get the value of defaultJavaNamingMethod which specifies the method for converting schema names for table and column to Java names. |
String |
getDefaultJavaType()
Get type to use in Java sources (primitive || object) |
Domain |
getDomain(String domainName)
|
String |
getFileName()
|
String |
getJavaName()
Get the base name to use when creating related Java Classes. |
String |
getName()
Get the name of the Database |
String |
getOption(String key)
Get the value that was associated with this key in an XML option element. |
Map |
getOptions()
Gets the full ordered hashtable array of items specified by XML option statements under this element. |
String |
getPackage()
Get the value of package. |
Platform |
getPlatform()
Returns the Platform implementation for this database. |
String |
getStandardJavaName()
Convert dbName to a Java compatible name by the JavaName method only (ignores the defaultJavaNamingMethod). |
Table |
getTable(String name)
Return the table with the specified name. |
Table |
getTableByJavaName(String javaName)
Return the table with the specified javaName. |
List |
getTables()
Return an List of all tables |
boolean |
isHeavyIndexing()
Get the value of heavyIndexing. |
void |
loadFromXML(Attributes attrib)
Load the database object from an xml tag. |
boolean |
requiresIdTable()
Determines if this database will be using the IDMethod.ID_BROKER to create ids for torque OM
objects. |
void |
setBaseClass(String v)
Set the value of baseClass. |
void |
setBasePeer(String v)
Set the value of basePeer. |
void |
setDatabaseType(String databaseType)
|
void |
setDefaultIdMethod(String v)
Set the value of defaultIdMethod. |
void |
setDefaultJavaNamingMethod(String v)
Set the value of defaultJavaNamingMethod. |
void |
setFileName(String name)
|
void |
setHeavyIndexing(boolean v)
Set the value of heavyIndexing. |
void |
setName(String name)
Set the name of the Database |
void |
setPackage(String v)
Set the value of package. |
String |
toString()
Creats a string representation of this Database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Database(String databaseType)
databaseType
- The default type for this database.Method Detail |
---|
public void loadFromXML(Attributes attrib)
attrib
- the xml attributespublic String getName()
public void setName(String name)
name
- name of the Databasepublic String getFileName()
public void setFileName(String name)
public String getPackage()
public void setPackage(String v)
v
- Value to assign to package.public String getBaseClass()
public void setBaseClass(String v)
v
- Value to assign to baseClass.public String getBasePeer()
public void setBasePeer(String v)
v
- Value to assign to basePeer.public String getDefaultIdMethod()
public void setDefaultIdMethod(String v)
v
- Value to assign to defaultIdMethod.public String getDefaultJavaType()
public String getDefaultJavaNamingMethod()
public void setDefaultJavaNamingMethod(String v)
v
- The default naming conversion for this database to use.public boolean isHeavyIndexing()
public void setHeavyIndexing(boolean v)
v
- Value to assign to heavyIndexing.public List getTables()
public Table getTable(String name)
name
- table name
public Table getTableByJavaName(String javaName)
javaName
- name of the java object representing the table
public Table addTable(Attributes attrib)
attrib
- the xml attributes
public void addTable(Table tbl)
tbl
- the table to addpublic void addDomain(Domain domain)
public Domain getDomain(String domainName)
protected String getDatabaseType()
public void setDatabaseType(String databaseType)
public Platform getPlatform()
public boolean requiresIdTable()
IDMethod.ID_BROKER
to create ids for torque OM
objects.
IDMethod.ID_BROKER
method
of generating ids. returns false otherwise.public void doFinalInitialization() throws EngineException
EngineException
public String getJavaName()
public String getStandardJavaName()
public String toString()
toString
in class Object
public void addOption(String key, String value)
key
- the key of the option.value
- the value of the option.public String getOption(String key)
key
- the key of the option.
public Map getOptions()
Note, this is not thread save but since it's only used for generation which is single threaded, there should be minimum danger using this in Velocity.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |