|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.tools.schemaframework.SchemaManager
public class SchemaManager
Purpose: Define all user level protocol for development time database manipulation.
Responsibilities:
Field Summary | |
---|---|
protected java.io.Writer |
createSchemaWriter
|
protected boolean |
createSQLFiles
|
protected TableCreator |
defaultTableCreator
|
protected java.io.Writer |
dropSchemaWriter
|
static boolean |
FAST_TABLE_CREATOR
Allow table creator to occur "fast" by just deleting all the rows. |
protected org.eclipse.persistence.internal.sessions.DatabaseSessionImpl |
session
|
Constructor Summary | |
---|---|
SchemaManager(DatabaseSession session)
|
|
SchemaManager(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
|
Method Summary | |
---|---|
void |
alterSequence(SequenceDefinition sequenceDefinition)
Use the definition to alter sequence. |
void |
appendToDDLWriter(java.lang.String stringToWrite)
PUBLIC: If the schema manager is writing to a writer, append this string to that writer. |
void |
appendToDDLWriter(java.io.Writer schemaWriter,
java.lang.String stringToWrite)
|
void |
buildFieldTypes(TableDefinition tableDef)
INTERNAL: builds the field names based on the type read in from the builder |
protected SequenceDefinition |
buildSequenceDefinition(Sequence sequence)
|
void |
closeDDLWriter()
PUBLIC: Close the schema writer. |
void |
closeDDLWriter(java.io.Writer schemaWriter)
|
void |
createConstraints(TableDefinition tableDefinition)
Use the table definition to add the constraints to the database, this is normally done in two steps to avoid dependencies. |
void |
createDefaultTables(boolean generateFKConstraints)
Create the default table schema for the TopLink project this session associated with. |
void |
createObject(DatabaseObjectDefinition databaseObjectDefinition)
Use the definition object to create the schema entity on the database. |
protected void |
createOrReplaceSequences(boolean create)
Common implementor for createSequence and replaceSequence |
protected void |
createOrReplaceSequences(boolean createSequenceTables,
boolean createSequenceObjects)
Common implementor for createSequence and replaceSequence, distinguishes between sequence tables and sequence objects |
void |
createSequences()
Create all the receiver's sequences on the database for all of the loaded descriptors. |
void |
dropConstraints(TableDefinition tableDefinition)
Use the table definition to drop the constraints from the table, this is normally done in two steps to avoid dependencies. |
void |
dropObject(DatabaseObjectDefinition databaseObjectDefinition)
Use the definition object to drop the schema entity from the database. |
void |
dropTable(java.lang.String tableName)
Drop (delete) the table named tableName from the database. |
void |
finalize()
INTERNAL: Close the schema writer when the schema manger is garbage collected |
void |
generateStoredProcedures()
PUBLIC: Use this method to generate stored procedures based on the dynamic SQL generated for your mappings and descriptors. |
void |
generateStoredProcedures(java.io.Writer writer)
PUBLIC: Use this method to generate stored procedures based on the dynamic SQL generated for your mappings and descriptors. |
void |
generateStoredProceduresAndAmendmentClass(java.lang.String path,
java.lang.String fullyQualifiedClassName)
PUBLIC: Use this method to generate stored procedures based on the dynamic SQL generated for your mappings and descriptors. |
void |
generateStoredProceduresAndAmendmentClass(java.io.Writer writer,
java.lang.String fullyQualifiedClassName)
PUBLIC: Use this method to generate stored procedures based on the dynamic SQL generated for your mappings and descriptors. |
protected org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor |
getAccessor()
Return the appropriate accessor. |
java.util.Vector |
getAllColumnNames(java.lang.String tableName)
Get a description of table columns available in a catalog. |
java.util.Vector |
getAllColumnNames(java.lang.String creatorName,
java.lang.String tableName)
Get a description of table columns available in a catalog. |
java.util.Vector |
getAllTableNames()
Get a description of tables available in a catalog. |
java.util.Vector |
getAllTableNames(java.lang.String creatorName)
Get a description of table columns available in a catalog. |
java.util.Vector |
getColumnInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String columnName)
Get a description of table columns available in a catalog. |
protected TableCreator |
getDefaultTableCreator(boolean generateFKConstraints)
Construct the default TableCreator. |
protected java.io.Writer |
getDropSchemaWriter()
|
org.eclipse.persistence.internal.sessions.AbstractSession |
getSession()
|
java.util.Vector |
getTableInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String[] types)
Get a description of tables available in a catalog. |
void |
outputCreateDDLToFile(java.lang.String fileName)
|
void |
outputCreateDDLToWriter(java.io.Writer createWriter)
|
void |
outputDDLToDatabase()
PUBLIC: Output all DDL statements directly to the database. |
void |
outputDDLToFile(java.lang.String fileName)
PUBLIC: Output all DDL statements to a file writer specified by the name in the parameter. |
void |
outputDDLToWriter(java.io.Writer schemaWriter)
PUBLIC: Output all DDL statements to a writer specified in the parameter. |
void |
outputDropDDLToFile(java.lang.String fileName)
|
void |
outputDropDDLToWriter(java.io.Writer dropWriter)
|
void |
replaceDefaultTables()
Drop and recreate the default table schema for the TopLink project this session associated with. |
void |
replaceDefaultTables(boolean keepSequenceTables,
boolean generateFKConstraints)
Drop and recreate the default table schema for the TopLink project this session associated with. |
void |
replaceObject(DatabaseObjectDefinition databaseDefinition)
Use the definition object to drop and recreate the schema entity on the database. |
void |
replaceSequences()
Drop and recreate all the receiver's sequences on the database for all of the loaded descriptors. |
void |
setCreateSQLFiles(boolean genFlag)
|
void |
setSession(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
|
boolean |
shouldWriteToDatabase()
PUBLIC: Return true if this SchemaManager should write to the database directly |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session
protected java.io.Writer createSchemaWriter
protected java.io.Writer dropSchemaWriter
protected boolean createSQLFiles
protected TableCreator defaultTableCreator
public static boolean FAST_TABLE_CREATOR
Constructor Detail |
---|
public SchemaManager(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
public SchemaManager(DatabaseSession session)
Method Detail |
---|
protected java.io.Writer getDropSchemaWriter()
public void appendToDDLWriter(java.lang.String stringToWrite)
public void appendToDDLWriter(java.io.Writer schemaWriter, java.lang.String stringToWrite)
public void buildFieldTypes(TableDefinition tableDef)
public void closeDDLWriter()
public void closeDDLWriter(java.io.Writer schemaWriter)
public void createConstraints(TableDefinition tableDefinition) throws EclipseLinkException
EclipseLinkException
public void createObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException
EclipseLinkException
public void createSequences() throws EclipseLinkException
EclipseLinkException
public void setCreateSQLFiles(boolean genFlag)
public void replaceSequences() throws EclipseLinkException
EclipseLinkException
protected void createOrReplaceSequences(boolean create) throws EclipseLinkException
create
- - true to create the sequences, false to replace them (dropped then create)
EclipseLinkException
protected void createOrReplaceSequences(boolean createSequenceTables, boolean createSequenceObjects) throws EclipseLinkException
createSequenceTables
- - true to create the sequences tables, false to replace them (dropped then create)createSequenceObjects
- - true to create the sequences objects, false to replace them (dropped then create)
EclipseLinkException
protected SequenceDefinition buildSequenceDefinition(Sequence sequence)
public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException
EclipseLinkException
public void dropObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException
EclipseLinkException
public void dropTable(java.lang.String tableName) throws EclipseLinkException
EclipseLinkException
public void finalize()
finalize
in class java.lang.Object
public void generateStoredProcedures() throws EclipseLinkException
EclipseLinkException
public void generateStoredProcedures(java.io.Writer writer) throws EclipseLinkException
EclipseLinkException
public void generateStoredProceduresAndAmendmentClass(java.io.Writer writer, java.lang.String fullyQualifiedClassName) throws EclipseLinkException
EclipseLinkException
public void generateStoredProceduresAndAmendmentClass(java.lang.String path, java.lang.String fullyQualifiedClassName) throws EclipseLinkException
EclipseLinkException
protected org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor getAccessor()
public java.util.Vector getAllColumnNames(java.lang.String tableName) throws DatabaseException
Each column description has the following columns:
tableName
- a table name pattern
DatabaseException
public java.util.Vector getAllColumnNames(java.lang.String creatorName, java.lang.String tableName) throws DatabaseException
Each column description has the following columns:
creatorName
- a schema name pattern; "" retrieves those
without a schematableName
- a table name pattern
DatabaseException
public java.util.Vector getAllTableNames() throws DatabaseException
Each table description has the following columns:
Note: Some databases may not return information for all tables.
DatabaseException
public java.util.Vector getAllTableNames(java.lang.String creatorName) throws DatabaseException
Each column description has the following columns:
creatorName
- a schema name pattern; "" retrieves those
without a schema
DatabaseException
public java.util.Vector getColumnInfo(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.lang.String columnName) throws DatabaseException
Only column descriptions matching the catalog, schema, table and column name criteria are returned. They are ordered by TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION.
Each column description has the following columns:
catalog
- a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection criteriaschema
- a schema name pattern; "" retrieves those
without a schematableName
- a table name patterncolumnName
- a column name pattern
DatabaseException
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
public java.util.Vector getTableInfo(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.lang.String[] types) throws DatabaseException
Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
Each table description has the following columns:
Note: Some databases may not return information for all tables.
catalog
- a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection criteriaschema
- a schema name pattern; "" retrieves those
without a schematableName
- a table name patterntypes
- a list of table types to include; null returns all types
DatabaseException
public void outputDDLToDatabase()
public void outputDDLToFile(java.lang.String fileName)
public void outputCreateDDLToFile(java.lang.String fileName)
public void outputDropDDLToFile(java.lang.String fileName)
public void outputDDLToWriter(java.io.Writer schemaWriter)
public void outputCreateDDLToWriter(java.io.Writer createWriter)
public void outputDropDDLToWriter(java.io.Writer dropWriter)
public void replaceObject(DatabaseObjectDefinition databaseDefinition) throws EclipseLinkException
EclipseLinkException
protected TableCreator getDefaultTableCreator(boolean generateFKConstraints)
public void createDefaultTables(boolean generateFKConstraints)
public void replaceDefaultTables() throws EclipseLinkException
EclipseLinkException
public void replaceDefaultTables(boolean keepSequenceTables, boolean generateFKConstraints) throws EclipseLinkException
EclipseLinkException
public void setSession(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
public boolean shouldWriteToDatabase()
public void alterSequence(SequenceDefinition sequenceDefinition) throws EclipseLinkException
EclipseLinkException
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |