|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.DBObjectFactory
public class DBObjectFactory
Factory to control the creation of SchemaObjects
and ChildDBObjects
which may be based on templates and/or have the initial values of properties defined by PropertyInitializers
.
The DBObjectFactory supports all SchemaObjects and the following ChildDBObject types
Column
PKConstraint
UniqueConstraint
FKConstraint
CheckConstraint
Index
TablePartition
IndexPartition
Constructor Summary | |
---|---|
protected |
DBObjectFactory(DBObjectProvider pro) Constructor has protected access as API users should retrieve a factory from the provider, and not instantiate their own. |
Method Summary | ||
---|---|---|
protected BaseObjectID |
createID(DBObject obj) |
|
protected void |
ensureBaseInfo(BaseObjectID id, DBObject obj, boolean forceName) |
|
DBObjectID |
ensureID(DBObject obj, boolean recurse, boolean forceNames) Checks that the given object has an ID that is set up for the factory's provider. |
|
void |
ensureProvider(BaseObjectID id) Initialises the given id's provider to be the factory's provider if it wasn't already set. |
|
void |
ensureSchema(SchemaObject obj) Ensures that the given object's Schema is the same instance that the provider has, and not a copy, or separate instance with the same name. |
|
protected DBObjectID |
findParentID(DBObjectID parentID) |
|
java.lang.Object |
getExternalDefaultValue(DBObject obj, java.lang.String propertyName) The target database defined by getProvider() may set properties of objects at generation time if the value of those properties is not defined in the DDL. |
|
java.lang.Object |
getInitialValue(DBObject obj, java.lang.String propertyName) |
|
protected java.util.logging.Logger |
getLogger() |
|
protected DBObjectProvider |
getProvider() |
|
protected boolean |
isValidID(DBObjectID id) |
|
|
newObject(java.lang.Class<T> clz) Creates a new DBObject of the specified class using the default template if one exists, and with properties initialized according to all registered PropertyInitializers . |
|
|
newObject(java.lang.Class<T> clz, DBObject parent) Creates a new DBObject of the specified class using the default template if one exists, and with properties initialized according to all registered PropertyInitializers . |
|
|
newObject(java.lang.Class<T> clz, DBObject parent, boolean useDefaultTemplate) Creates a new DBObject of the specified class optionally using the default template if one exists, and with properties initialized according to all registered PropertyInitializers . |
|
|
newObject(T template) Creates a new object using the given template with properties initialized according to all registered PropertyInitializers , |
|
|
newObject(T template, DBObject parent) Creates a new object using the given template with properties initialized according to all registered PropertyInitializers , |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DBObjectFactory(DBObjectProvider pro)
Method Detail |
---|
protected DBObjectProvider getProvider()
protected java.util.logging.Logger getLogger()
public <T extends DBObject> T newObject(T template)
PropertyInitializers
,public <T extends DBObject> T newObject(T template, DBObject parent)
PropertyInitializers
,template
- the template to use for the new objectparent
- the parent of the new object - e.g. a Schema for a new Sequence, a Table for a new column etc.public <T extends DBObject> T newObject(java.lang.Class<T> clz)
DBObject
of the specified class using the default template if one exists, and with properties initialized according to all registered PropertyInitializers
.clz
- the class of object to createpublic <T extends DBObject> T newObject(java.lang.Class<T> clz, DBObject parent)
DBObject
of the specified class using the default template if one exists, and with properties initialized according to all registered PropertyInitializers
.clz
- the class of object to createparent
- the parent of the new object - e.g. a Schema for a new Sequence, a Table for a new column etc.public <T extends DBObject> T newObject(java.lang.Class<T> clz, DBObject parent, boolean useDefaultTemplate)
DBObject
of the specified class optionally using the default template if one exists, and with properties initialized according to all registered PropertyInitializers
.clz
- the class of object to createparent
- the parent of the new object - e.g. a Schema for a new Sequence, a Table for a new column etc.useDefaultTempalte
- whether to use the default template from the provider for the given object type (if such a template is registered)public java.lang.Object getExternalDefaultValue(DBObject obj, java.lang.String propertyName)
getProvider()
may set properties of objects at generation time if the value of those properties is not defined in the DDL. By using the registered any such "external default values" can be defined.public java.lang.Object getInitialValue(DBObject obj, java.lang.String propertyName)
public void ensureSchema(SchemaObject obj)
It is only anticipated that this method will be needed internally.
obj
- the SchemaObject to check the Schema forpublic DBObjectID ensureID(DBObject obj, boolean recurse, boolean forceNames)
It is only anticipated that this method will be needed internally.
the
- object to ensure has a valid ID for this factory's providerboolean
- whether to recurse and process the objects' child objects as wellforceNames
- if true this will additionally set the name based information on identifier based IDs. This is a potentially more time consuming operation as it may require dependent objects to be loaded.protected boolean isValidID(DBObjectID id)
protected BaseObjectID createID(DBObject obj)
protected void ensureBaseInfo(BaseObjectID id, DBObject obj, boolean forceName)
protected DBObjectID findParentID(DBObjectID parentID)
public final void ensureProvider(BaseObjectID id)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |