|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface to perform limited storage management on a database schema
used by TJDO.
This interface extends SchemaManagementOptions
and allows management
options to be modified.
Any changes made only affect operations performed using the same schema
manager, and otherwise have no effect on operations performed through the
normal JDO API.
SchemaManagerFactory
Method Summary | |
void |
addClasses(java.lang.Class[] classes)
Adds to the schema any database objects (tables, views, constraints, indexes, etc.) necessary to enable persistence of the given PersistenceCapable class(es). |
void |
dropAllTables()
Drops all tables in the schema. |
void |
dropTablesFor(java.lang.Class[] classes)
Removes from the schema any existing database tables used in persisting the given PersistenceCapable class(es). |
java.lang.String |
getCatalogName()
Returns the name of the database catalog. |
int |
getClassId(java.lang.Class clazz)
Returns the class ID number for the specified persistence-capable class. |
java.util.Date |
getCurrentTimestamp()
Returns a timestamp reflecting the database's current date and time. |
java.lang.String |
getDatabaseUrl()
Returns the connection URL for the database. |
java.lang.String |
getSchemaName()
Returns the name of the database schema. |
void |
reset()
Resets the schema manager back to its initial state. |
java.lang.Class[] |
storedClasses()
Returns the set of PersistenceCapable classes currently stored in this schema. |
Methods inherited from interface com.triactive.jdo.SchemaManagementOptions |
getAutoCreateTables, getValidateConstraints, getValidateTables, setAutoCreateTables, setValidateConstraints, setValidateTables |
Method Detail |
public java.lang.String getDatabaseUrl()
DatabaseMetaData.getURL()
public java.lang.String getCatalogName()
null
if the DBMS
does not support the concept of catalogs.public java.lang.String getSchemaName()
null
if the DBMS
does not support the concept of schemas.public java.util.Date getCurrentTimestamp()
java.lang.UnsupportedOperationException
- If no method is available for determining the database's current
timestamp.public void addClasses(java.lang.Class[] classes)
This method is primarily useful for applications that wish to perform all of their database initialization up front, rather than wait for the TJDO runtime to do it on-demand.
SQL identifiers for new database objects are chosen so as not to collide with any existing objects. Therefore it is always safe for TJDO and non-TJDO code to share the same database schema.
classes
- The class(es) to be added.
SchemaValidationException
- If there is some mismatch between the current schema contents and
those necessary to enable persistence of the given classes.public java.lang.Class[] storedClasses()
Not all of the returned classes have necessarily been initialized by
TJDO's store manager.
That is, some may not have been accessed yet by application code or
forcibly initialized by addClasses(java.lang.Class[])
.
The sequence:
can be used to forcibly initialize every known class in the schema.schemaManager.addClasses(schemaManager.storedClasses());
public int getClassId(java.lang.Class clazz)
object IDs
used for JDO datastore identity in TJDO.
If it hasn't already been added, this method adds the specified class to the schema.
clazz
- a persistence-capable class
OID
public void dropTablesFor(java.lang.Class[] classes)
This method will fail if the relevant tables are depended upon by others used for classes that are not being removed. In case of failure, it is unspecified whether or not any tables were actually removed.
After dropping tables this method performs an implicit reset()
.
classes
- The class(es) whose tables are to be removed.public void dropAllTables()
After dropping tables this method performs an implicit reset()
.
public void reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |