|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.javatools.db.property.AbstractPropertyManager
oracle.javatools.db.ddl.TokenDDLGenerator<T>
public class TokenDDLGenerator<T extends DDLType>
TokenDDLGenerator is DDLGenerator implementation that takes the registration
of "ddl code tokens" and registers CreateDDLGenerator
,
DropDDLGenerator
and AlterDDLGenerator
with the superclass
as appropriate. This allows users (or subclasses) to create a full
DDLGenerator implementation just by provider ddl "token code" which will then
be processed as appropriate when DDL is requested.
Constructor Summary | |
---|---|
TokenDDLGenerator(DBObjectProvider pro)
Note the first parameter is a DBObjectProvider. |
Method Summary | |
---|---|
protected boolean |
canChangeWithAlter(DBObject orig,
DBObject update,
java.lang.String prop)
Returns true if the given property can be changed using an alter on the given original and updated objects. |
protected boolean |
canCreate(java.lang.String type,
java.lang.String prop)
Tests whether the given property is supported for create on the given object type. |
protected DDL |
createDDL(DDLOptions options,
java.lang.String code,
DBObject obj,
DDLType ddlType)
Creates a new DDL object with the given ddlCode by processing the given code using a TokenProcessor and using the resulting String as the DDL string. |
protected DDL |
createUpdateDDL(DDLOptions options,
java.lang.String code,
ResultSet rs,
DDLType ddlType)
Creates a new update DDL object with the given ddlCode by processing the given update code using a TokenProcessor and using the resulting String as the DDL string. |
protected DDL<T> |
finish(DDLOptions options,
DDL<T> ddl)
This method is called on every DDL created before it is returned. |
DDL<T> |
getCreateDDL(DDLOptions options,
DBObject... objects)
Gets CREATE statements for the given objects. |
Ddl |
getCreateDDL(Schema schema)
Retrieves the DDL for creating a new Schema |
Ddl |
getCreateDDL(SchemaObject[] objects,
boolean replace,
boolean cascade)
Retrieves the DDL for creating the specified objects. |
Ddl |
getCreateDDL(SchemaObject obj,
boolean replace,
boolean cascade)
Retrieves the DDL for creating the specified object. |
protected DDL<T> |
getCreateDDLImpl(DDLOptions options,
DBObject... objects)
|
DDL<T> |
getDeleteDDL(DDLOptions options,
DBObject... objects)
Gets DROP statements for the given objects. |
Ddl |
getDeleteDDL(Schema schema,
boolean cascade)
|
Ddl |
getDeleteDDL(SchemaObject[] objects,
boolean cascade)
Retrieves the DDL for deleting an array of objects. |
Ddl |
getDeleteDDL(SchemaObject object,
boolean cascade)
Retrieves the DDL for deleting an object. |
protected DDL<T> |
getDeleteDDLImpl(DDLOptions options,
DBObject... objects)
|
protected DiffEngine |
getLegacyDiffEngine(java.lang.String type)
Deprecated. |
DDL<T> |
getUndeleteDDL(DDLOptions options,
DBObject... objects)
Gets statements to undelete (e.g. |
DDL<T> |
getUpdateDDL(DDLOptions options,
ResultSet resultSet)
Gets ALTER statements for the given objects where possible, or DROP/CREATE, or CREATE AND REPLACE where appropriate/necessary. |
Ddl[] |
getUpdateDDL(ResultSet resultSet,
boolean replace,
boolean cascade)
Retrieves the DDL for updating the definition of an object. |
Ddl[] |
getUpdateDDL(SchemaObject[] oldObjects,
SchemaObject[] newObjects)
Retrieves DDL to update an array of SchemaObject objects. |
Ddl[] |
getUpdateDDL(SchemaObject oldObject,
SchemaObject newObject)
Retrieves the DDL for updating the definition of an object. |
protected DDL<T> |
getUpdateDDLImpl(DDLOptions options,
ResultSet rs)
Gets the update DDL for the given ResultSet. |
protected void |
processResultSet(DDLOptions options,
ResultSet rs,
DDL<T> ddl)
|
void |
registerAlterDDL(java.lang.String type,
java.lang.String code,
DDLType ddlType)
|
protected void |
registerAlterGenerator(java.lang.String type,
AlterDDLGenerator deletor)
|
void |
registerCreateDDL(java.lang.String type,
java.lang.String code,
DDLType ddlType)
|
protected void |
registerCreateGenerator(java.lang.String type,
CreateDDLGenerator creator)
|
void |
registerDropDDL(java.lang.String type,
java.lang.String code,
DDLType ddlType)
|
protected void |
registerDropGenerator(java.lang.String type,
DropDDLGenerator dropper)
|
void |
registerTokenGenerator(java.lang.String tokenName,
TokenGenerator gen)
Registers the given token generator for a tokenName. |
void |
registerUndeleteDDL(java.lang.String type,
java.lang.String code,
DDLType ddlType)
|
protected void |
registerUndeleteGenerator(java.lang.String type,
UndeleteDDLGenerator undeletor)
|
void |
setOldGenerator(AbstractDDLGenerator oldGen)
Deprecated. - the old DDLGenerator API is
deprecated so this method will be removed when it is. |
boolean |
supportsAction(java.lang.String type,
PropertyAction action)
Asks whether a given action is supported for the specified object type in this provider. |
Methods inherited from class oracle.javatools.db.property.AbstractPropertyManager |
---|
canChangeProperty, canChangeWithReplace, canCreate, canUpdateObject, canUpdateObject, getLogger, getProvider, getProviderClass, supportsProperty, supportsProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.property.PropertyManager |
---|
canChangeProperty, canUpdateObject, canUpdateObject, supportsProperty |
Constructor Detail |
---|
public TokenDDLGenerator(DBObjectProvider pro)
Method Detail |
---|
public void registerTokenGenerator(java.lang.String tokenName, TokenGenerator gen)
tokenName
- the token name this new generator is responsible forgen
- the generator itselfpublic final void registerCreateDDL(java.lang.String type, java.lang.String code, DDLType ddlType)
public final void registerDropDDL(java.lang.String type, java.lang.String code, DDLType ddlType)
public final void registerUndeleteDDL(java.lang.String type, java.lang.String code, DDLType ddlType)
public final void registerAlterDDL(java.lang.String type, java.lang.String code, DDLType ddlType)
protected DDL createDDL(DDLOptions options, java.lang.String code, DBObject obj, DDLType ddlType)
This method can return null if the token processor returns an empty string. This is possible if the entire statement is an "if" which is allowed for certain DDL statements (which may only execute given certain conditions/properties).
options
- the ddl generation optionscode
- the token code to processobj
- the context objectddlCode
- the type of DDL we are creating
protected DDL createUpdateDDL(DDLOptions options, java.lang.String code, ResultSet rs, DDLType ddlType)
This method can return null if the token processor returns an empty string. This is possible if the entire statement is an "if" which is allowed for certain DDL statements (which may only execute given certain conditions/properties).
options
- the ddl generation optionscode
- the token code to processrs
- the changes to generate update DDL forddlCode
- the type of DDL we are creating
protected final void registerCreateGenerator(java.lang.String type, CreateDDLGenerator creator)
protected final void registerDropGenerator(java.lang.String type, DropDDLGenerator dropper)
protected final void registerAlterGenerator(java.lang.String type, AlterDDLGenerator deletor)
protected final void registerUndeleteGenerator(java.lang.String type, UndeleteDDLGenerator undeletor)
protected DDL<T> getCreateDDLImpl(DDLOptions options, DBObject... objects)
protected DDL<T> getDeleteDDLImpl(DDLOptions options, DBObject... objects)
public DDL<T> getUndeleteDDL(DDLOptions options, DBObject... objects)
DDLGenerator
protected DDL<T> getUpdateDDLImpl(DDLOptions options, ResultSet rs)
options
- the options for generationrs
- the ResultSet for the object to alter
protected boolean canCreate(java.lang.String type, java.lang.String prop)
AbstractPropertyManager
protected DDL<T> finish(DDLOptions options, DDL<T> ddl)
options
- the options for the current generationddl
- the ddl we've generated and are about to returnpublic boolean supportsAction(java.lang.String type, PropertyAction action)
PropertyManager
supportsAction
in interface PropertyManager
protected boolean canChangeWithAlter(DBObject orig, DBObject update, java.lang.String prop)
AbstractPropertyManager
canChangeWithAlter
in class AbstractPropertyManager
@Deprecated public final void setOldGenerator(AbstractDDLGenerator oldGen)
DDLGenerator
API is
deprecated so this method will be removed when it is.
public final DDL<T> getCreateDDL(DDLOptions options, DBObject... objects)
DDLGenerator
public final DDL<T> getDeleteDDL(DDLOptions options, DBObject... objects)
DDLGenerator
public final DDL<T> getUpdateDDL(DDLOptions options, ResultSet resultSet)
DDLGenerator
@Deprecated protected DiffEngine getLegacyDiffEngine(java.lang.String type)
protected final void processResultSet(DDLOptions options, ResultSet rs, DDL<T> ddl)
public final Ddl getCreateDDL(SchemaObject obj, boolean replace, boolean cascade)
DDLGenerator
If the replace option is specified, and the object exists in the provider, DDL is create to drop the object. (except views, where CREATE OR REPLACE is generated)
getCreateDDL
in interface DDLGenerator
obj
- the object for which DDL is requiredreplace
- whether an existing object should be replacedcascade
- whether any DROP associated with replace should be cascaded
public final Ddl getCreateDDL(SchemaObject[] objects, boolean replace, boolean cascade)
DDLGenerator
If the replace option is specified, DDL is generated to drop all the Foreign Keys in the tables in the specified objects. DDL is then generated to drop all of the specified objects (except views) which exist in the provider.
getCreateDDL
in interface DDLGenerator
replace
- whether an existing object should be replacedcascade
- whether any DROP associated with replace should be cascaded
public final Ddl getDeleteDDL(SchemaObject object, boolean cascade)
DDLGenerator
getDeleteDDL
in interface DDLGenerator
object
- the object to be deletedcascade
- a boolean value indicating whether a cascade delete
should be performed, if appropriate for the object type
public final Ddl getDeleteDDL(SchemaObject[] objects, boolean cascade)
DDLGenerator
getDeleteDDL
in interface DDLGenerator
cascade
- a boolean value indicating whether a cascade delete
should be performed, if appropriate for the object type
public final Ddl[] getUpdateDDL(SchemaObject oldObject, SchemaObject newObject)
DDLGenerator
getUpdateDDL
in interface DDLGenerator
oldObject
- the original version of the objectnewObject
- the updated data model
public final Ddl[] getUpdateDDL(SchemaObject[] oldObjects, SchemaObject[] newObjects)
DDLGenerator
SchemaObject
objects.
The generated DDL will modified the dbUpdatable
objects
to match the dbMaster
objects.
getUpdateDDL
in interface DDLGenerator
oldObjects
- the original versions of the objectsnewObjects
- the updated data model
public final Ddl[] getUpdateDDL(ResultSet resultSet, boolean replace, boolean cascade)
DDLGenerator
getUpdateDDL
in interface DDLGenerator
resultSet
- description of the differences between two objectsreplace
- whether to replace any existing objects being createdcascade
- whether to cascade the delete of any objects
public final Ddl getCreateDDL(Schema schema)
DDLGenerator
getCreateDDL
in interface DDLGenerator
schema
- the Schema for which the DDL is required
public final Ddl getDeleteDDL(Schema schema, boolean cascade)
getDeleteDDL
in interface DDLGenerator
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |