Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.db
Interface DBObjectProvider

All Known Subinterfaces:
Database, JdbcDatabase, OracleDatabase, OracleDatabaseXE
All Known Implementing Classes:
AbstractDatabase, AbstractDBObjectProvider, DDLDatabase, DictionaryDatabase, OfflineDBObjectProvider

public interface DBObjectProvider

The DBObjectProvider interface provides clients with access to database objects. Depending on the implementation, these objects may be defined in an existing database or locally.

The services provided by DBObjectProvider include:

A DBObjectProvider can be retrieved through the DBObjectProviderFactory if the identifier is known for that provider. For more information see @link{DBObjectProviderFactory}.

The api provides a listener mechanism for a DBObjectProvider so that if objects are added, removed or updated through the DBObjectProvider a registered DBObjectProviderListener will be notified of those events.

See Also:
oracle.javatools.db, DBObjectProviderFactory, Database, DBObjectProviderListener

Field Summary
static java.lang.String CREATE_PRIVILEDGE
          Permission to create an object.
static java.lang.String DELETE_PRIVILEDGE
          Permission to delete an object.
static java.lang.String MODIFY_PRIVILEDGE
          Permission to modify an object.
static java.lang.String NEW_FROM_TEMPLATE_TYPE
          Deprecated. 
 
Method Summary
 void addProviderListener(DBObjectProviderListener list)
          Adds the given listener to the list of registered listener for events on this provider.
 boolean canCreate(SystemObject object, boolean replace)
          Whether an attempt to create the specified object is likely to succeed.
 boolean canDelete(SystemObject object, boolean cascade)
          Checks to see whether a specific object can be deleted.
 void createObject(SystemObject object, boolean replace)
          Causes the creation of the object described by the specified meta data.
 void createObjects(SystemObject[] objects, boolean replace)
          Causes the creation of the objects described by the specified meta data.
 void createSchema(Schema schema, boolean replace)
          Causes the creation of a new Schema in the persistent storage.
 void deleteObject(SystemObject object, boolean cascade)
          Deletes the object.
 void deleteObjects(SystemObject[] objects, boolean cascade)
          Deletes the objects.
 void deleteSchema(Schema schema, boolean cascade)
          Deletes the schema.
 CascadeManager getCascadeManager()
          Gets the object for this provider that manages references between objects and how to cascade deletes between them.
 DataType getDataType(java.lang.String typeName)
          Retrieves the datatype represented by a specific name.
 Schema getDefaultSchema()
          Returns the default schema for the provider.
 DBObject getDefaultTemplateForType(java.lang.String type)
          Returns the default template object for the given type, or null if none defined
 DatabaseDescriptor getDescriptor()
          Returns the DatabaseDescriptor for this provider
 DiffEngine getDiffEngine()
          Returns a diff engine setup with the appropriate set of differs for object updating.
 java.lang.String getExternalName(java.lang.String name)
          Converts the specified name into the format used externally to represent the identifier.
 java.lang.String getExternalName(java.lang.String name, java.lang.String objectType)
          Converts the specified name into the format used externally to represent the identifier.
 java.lang.String getIdentifierQuoteString()
          Retrieves the string used to quote identifiers.
 java.lang.String getInternalName(java.lang.String name)
          Converts the specified name into the format used internally within the metadata.
 java.lang.String getInternalName(java.lang.String name, java.lang.String objectType)
          Converts the specified name into the format used internally within the metadata.
<T extends SystemObject>
T
getObject(DBObjectCriteria<T> criteria)
          Retrieves the SystemObject representing a specific database object.
 SchemaObject getObject(java.lang.String objectType, Schema schema, java.lang.String name)
          Retrieves the SchemaObject representing a specific database object.
 DBObjectFactory getObjectFactory()
          Get the object factory for this provider.
 SchemaObjectManager getObjectManager()
          Deprecated. use getCascadeManager()
 DataType getOrCreateDataType(java.lang.String typeName)
          Retrieves the datatype represented by a specific name.
 PropertyManager getPropertyManager()
          Gets the PropertyManager (if available) for this provider.
 Schema getSchema(java.lang.String name)
          Retrieves the Schema object associated with a specific name.
 java.lang.Long getTimestamp(DBObjectID id)
          Retrieves the timestamp for the object represented by the given ID.
 java.lang.Long getTimestamp(java.lang.String objectType, Schema schema, java.lang.String name)
          Retrieves the timestamp representing the last modification time of the specified object's metadata.
 java.lang.String getUniqueName(java.lang.String type, DBObject contextObject, java.lang.String base)
          Retrieves a unique name for an object of a specific type.
 boolean hasPriviledge(java.lang.String type, Schema schema, java.lang.String priv)
          Checks to see whether the user has the requisite permissions to perform the specified operation.
 boolean isEditable(DBObject object)
          Returns whether or not the object can be edited
 boolean isNewFromTemplateType(java.lang.String type)
          Test whether the given type is the pseudo type used for new objects that are being created from a template.
 boolean isValidName(java.lang.String name)
          Deprecated. - use isValidName( String type, String name )
 boolean isValidName(java.lang.String type, java.lang.String name)
          Checks to see whether a name is valid.
<T extends SystemObject>
java.util.Collection<T>
listObjects(DBObjectCriteria<T> filter)
          Lists the objects from this provider that match the given criteria.
 SchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema)
          Lists the objects of multiple types available from this provider.
 SchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema, java.lang.String ref)
          Lists the objects of multiple types available from this provider.
 java.lang.String[] listObjects(java.lang.String objectType, Schema schema)
          Lists the objects of a given type available from this provider.
 java.lang.String[] listObjects(java.lang.String objectType, Schema schema, java.lang.String ref)
          Lists the objects of a given type available from this provider.
 java.lang.String[] listObjectTypes()
          Lists the database object types supported by this DBObjectProvider.
 Schema[] listSchemas()
          Retrieves the list of schemas available from this provider regardless of their visibility to the user.
 Schema[] listSchemas(boolean showAll)
          Retrieves the list of schemas available from this provider.
 DataType[] listSupportedDataTypes()
          Retrieves the list of datatypes supported by this provider.
 java.lang.String quoteIdentifier(java.lang.String name, boolean force)
          Quotes the specified identifier name, if needed.
 void removeProviderListener(DBObjectProviderListener list)
          Removes the given listener from the list of registered listener for events on this provider.
 void setDefaultTemplateForType(java.lang.String type, DBObject template)
          Sets the default template object for the given type.
 boolean supportsObjectType(java.lang.String type)
          Convinience method to check whether this provider supports the given object type - i.e.
 void undeleteObject(SchemaObject object)
          Undeletes the object, i.e.
 void undeleteObjects(SchemaObject[] objects)
          Undeletes the objects, i.e.
 void updateObject(SystemObject oldObject, SystemObject newObject)
          Updates the definition of an object.
 void updateObjects(Difference rs, boolean replace, boolean cascade)
          Updates the definition of a set of objects.
 void updateObjects(SystemObject[] oldObjects, SystemObject[] newObjects)
          Updates the definition of a set of objects.
 void updateSchema(Schema oldSchema, Schema newSchema)
          Updates the definition of a Schema.
 void validateName(java.lang.String name)
          Deprecated. - use validateName( String type, String name )
 void validateName(java.lang.String type, java.lang.String name)
          Checks to see whether a name is valid for a given type of object.
 void validateObject(DBObject object)
          Checks to see if the object is valid.
 void validateObject(DBObject original, DBObject updated)
          Checks to see if the object update is valid.
 void validateObject(DBObject original, DBObject updated, java.lang.String property)
          Deprecated. use validateObjectProperty(DBObject,DBObject,Object)
 void validateObject(DBObject object, java.lang.String property)
          Deprecated. use validateObjectProperty(DBObject,Object)
 void validateObjectProperty(DBObject original, DBObject updated, java.lang.Object property)
          Deprecated. use validateObjectProperty(DBObject,DBObject,String)
 void validateObjectProperty(DBObject original, DBObject updated, java.lang.String property)
          Checks to see if the updated children of a given object are valid.
 void validateObjectProperty(DBObject object, java.lang.Object property)
          Deprecated. use validateObjectProperty(DBObject,String)
 void validateObjectProperty(DBObject object, java.lang.String property)
          Checks to see if the children of a given object are valid.
 void validateSchema(Schema schema)
          Deprecated. use validateObject(DBObject object)
 void validateSchema(Schema original, Schema updated)
          Deprecated. use validateObject(DBObject original, DBObject updated)
 void validateUniqueName(java.lang.String type, DBObject contextObject, java.lang.String name)
          Validates that a name is not used within a context DBObject, and throws NameInUseException if it is.
 

Field Detail

CREATE_PRIVILEDGE

static final java.lang.String CREATE_PRIVILEDGE
Permission to create an object.

See Also:
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String), Constant Field Values

DELETE_PRIVILEDGE

static final java.lang.String DELETE_PRIVILEDGE
Permission to delete an object.

See Also:
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String), Constant Field Values

MODIFY_PRIVILEDGE

static final java.lang.String MODIFY_PRIVILEDGE
Permission to modify an object.

See Also:
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String), Constant Field Values

NEW_FROM_TEMPLATE_TYPE

@Deprecated
static final java.lang.String NEW_FROM_TEMPLATE_TYPE
Deprecated. 
See Also:
Constant Field Values
Method Detail

addProviderListener

void addProviderListener(DBObjectProviderListener list)
Adds the given listener to the list of registered listener for events on this provider.

See Also:
DBObjectProviderListener

removeProviderListener

void removeProviderListener(DBObjectProviderListener list)
Removes the given listener from the list of registered listener for events on this provider.

See Also:
DBObjectProviderListener

canCreate

boolean canCreate(SystemObject object,
                  boolean replace)
Whether an attempt to create the specified object is likely to succeed.

Parameters:
object - the SystemObject describing the object to create
replace - whether to replace an existing object. If replace is false and the object exists, canCreate must return false.
Returns:
whether the create will succeed.

createObject

void createObject(SystemObject object,
                  boolean replace)
                  throws DBException
Causes the creation of the object described by the specified meta data.

Parameters:
object - the SystemObject describing the object to create.
replace - whether to replace an existing object. If replace is false and the object exists, createObject will fail.
Throws:
DBException - if an error is encountered creating the object.

createObjects

void createObjects(SystemObject[] objects,
                   boolean replace)
                   throws DBException
Causes the creation of the objects described by the specified meta data.

Parameters:
objects - the SystemObject[] describing the objects to create.
replace - whether to replace an existing objects. If replace is false and the object exists, createObjects will fail.
Throws:
DBException - if an error is encountered creating the objects.

canDelete

boolean canDelete(SystemObject object,
                  boolean cascade)
Checks to see whether a specific object can be deleted.

Parameters:
object - the object to check
cascade - whether to assume a cascading delete should be used.
Returns:
whether the delete, if attempted, would succeed.

deleteObject

void deleteObject(SystemObject object,
                  boolean cascade)
                  throws DBException
Deletes the object.

Parameters:
object - the object to delete
cascade - whether to delete dependent objects
Throws:
DBException - if an error is encountered performing the delete

deleteObjects

void deleteObjects(SystemObject[] objects,
                   boolean cascade)
                   throws DBException
Deletes the objects.

Parameters:
objects - the objects to delete
cascade - whether to delete dependent objects
Throws:
DBException - if an error is encountered performing the delete

undeleteObject

void undeleteObject(SchemaObject object)
                    throws DBException
Undeletes the object, i.e. removes it from the recycle bin. In Oracle, only tables and indexes can be undeleted.

Parameters:
object - the object to be undeleted
Throws:
DBException - if an error is encountered performing the undelete

undeleteObjects

void undeleteObjects(SchemaObject[] objects)
                     throws DBException
Undeletes the objects, i.e. removes them from the recycle bin. In Oracle, only tables and indexes can be undeleted.

Parameters:
objects - the objects to be undeleted
Throws:
DBException - if an error is encountered performing the undelete

hasPriviledge

boolean hasPriviledge(java.lang.String type,
                      Schema schema,
                      java.lang.String priv)
Checks to see whether the user has the requisite permissions to perform the specified operation. For example, whether the user has permission to create a new table in a specific schema.

Parameters:
type - the object type on which the operation is being performed.
schema - the schema to check. A value of null checks for the current schema.
priv - a pre-defined operation.
Returns:
whether the specified operation can be completed.

getUniqueName

java.lang.String getUniqueName(java.lang.String type,
                               DBObject contextObject,
                               java.lang.String base)
Retrieves a unique name for an object of a specific type. If base is unique, it returns base, otherwise, if base is suffixed with a number, it increments the number until it finds a unique name. If base isn't suffixed with a number, it appends 1 and increments the number until it finds a unique name.

Parameters:
type - is the type of object to get the name for
contextObject - is the database object context to use when determining the uniqueness of the name
base - is the base name to use. If base is null or zero length, the type name suffixed with 1 is used.
Returns:
a unique name for the given object type.

validateUniqueName

void validateUniqueName(java.lang.String type,
                        DBObject contextObject,
                        java.lang.String name)
                        throws NameInUseException
Validates that a name is not used within a context DBObject, and throws NameInUseException if it is. The NameInUseException should contain the name, and the DBObject containing the name.

Parameters:
type - : the type of name being validated
contextObject - : the database object context to use when determining the uniqueness of the name
name - : the name to be checked
Throws:
NameInUseException

isValidName

@Deprecated
boolean isValidName(java.lang.String name)
Deprecated. - use isValidName( String type, String name )

Checks to see whether a name is valid. Note that a valid name does not guarantee uniqueness.

Parameters:
name - the name to check
Returns:
whether the name is valid
See Also:
isValidName(java.lang.String, java.lang.String)

isValidName

boolean isValidName(java.lang.String type,
                    java.lang.String name)
Checks to see whether a name is valid. Note that a valid name does not guarantee uniqueness.

Parameters:
name - the name to check
type - the type of object the name is intended for
Returns:
whether the name is valid
Since:
11.0

validateName

@Deprecated
void validateName(java.lang.String name)
                  throws InvalidNameException
Deprecated. - use validateName( String type, String name )

Checks to see whether a name is valid. Note that a valid name does not guarantee uniqueness.

Parameters:
name - the name to check
Throws:
InvalidNameException - with appropriate message if the name is invalid.
See Also:
validateName(java.lang.String, java.lang.String)

validateName

void validateName(java.lang.String type,
                  java.lang.String name)
                  throws InvalidNameException
Checks to see whether a name is valid for a given type of object. Note that a valid name does not guarantee uniqueness.

Parameters:
name - the name to check
type - the type of object that the name is intended for (e.g. Table.TYPE )
Throws:
InvalidNameException - with appropriate message if the name is invalid.
Since:
11.0

quoteIdentifier

java.lang.String quoteIdentifier(java.lang.String name,
                                 boolean force)
                                 throws DBException
Quotes the specified identifier name, if needed.

Parameters:
name - the name to quote
force - whether to quote even if the identifier is valid already.
Returns:
the quoted name
Throws:
DBException - if the name when quoted is still invalid

getInternalName

java.lang.String getInternalName(java.lang.String name)
Converts the specified name into the format used internally within the metadata. Generally, internal names are not quoted; quoted names have the quotes removed. Unquoted names may be converted to a single case if the underlying provider does not support mixed case identifiers.

Parameters:
name - a String containing the name to convert
Returns:
the internal version of the name

getInternalName

java.lang.String getInternalName(java.lang.String name,
                                 java.lang.String objectType)
Converts the specified name into the format used internally within the metadata. Generally, internal names are not quoted; quoted names have the quotes removed. Unquoted names may be converted to a single case if the underlying provider does not support mixed case identifiers.

Parameters:
name - a String containing the name to convert
objectType - a String containing the type of object being named
Returns:
the internal version of the name

getExternalName

java.lang.String getExternalName(java.lang.String name)
Converts the specified name into the format used externally to represent the identifier. In most case, this is equivalent to calling quoteIdentifier, specifying false for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.

Parameters:
name - a String containing the name to externalize
Returns:
a String containing the externalized name

getExternalName

java.lang.String getExternalName(java.lang.String name,
                                 java.lang.String objectType)
Converts the specified name into the format used externally to represent the identifier. In most case, this is equivalent to calling quoteIdentifier, specifying false for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.

Parameters:
name - a String containing the name to externalize
objectType - a String containing the type of object being named
Returns:
a String containing the externalized name

getIdentifierQuoteString

java.lang.String getIdentifierQuoteString()
Retrieves the string used to quote identifiers. By default, the quote string is assumed to be ". If the quoting of identifiers is not supported by a subclass, that subclass should return null.

Returns:
the string containing the character or characters used to quote an identifier.

getDescriptor

DatabaseDescriptor getDescriptor()
Returns the DatabaseDescriptor for this provider


validateObject

void validateObject(DBObject object)
                    throws ValidationException
Checks to see if the object is valid. If the object is a child object (e.g. a Column) this will not validate its place in the parent, only the individual DBObject definition.

Parameters:
object - The object to validate
Throws:
ValidationException - if the object is not valid. The exception will describe the validation failure. A MissingValidatorException is thrown if the provider has no validator for the given object type.

validateObject

@Deprecated
void validateObject(DBObject object,
                               java.lang.String property)
                    throws ValidationException
Deprecated. use validateObjectProperty(DBObject,Object)

Throws:
ValidationException

validateObjectProperty

void validateObjectProperty(DBObject object,
                            java.lang.String property)
                            throws ValidationException
Checks to see if the children of a given object are valid. If the object has no children of the given type a MissingValidatorException will be thrown. This is a convinience method to perform validation to a specific property on an object - all properties will be validated if validateObject(DBObject) is called.

Parameters:
object - The object to validate
property - An identifier for a specific property to validate
Throws:
ValidationException - if the object is not valid. The exception will describe the validation failure. A MissingValidatorException is thrown if the provider has no validator for the given object type, or property.

validateObjectProperty

@Deprecated
void validateObjectProperty(DBObject object,
                                       java.lang.Object property)
                            throws ValidationException
Deprecated. use validateObjectProperty(DBObject,String)

Throws:
ValidationException

validateObject

void validateObject(DBObject original,
                    DBObject updated)
                    throws ValidationException
Checks to see if the object update is valid.

Parameters:
object - The original object
object - The updated object to validate
Throws:
ValidationException - if the updated object is not valid. The exception will describe the validation failure. A MissingValidatorException is thrown if the provider has no validator for the given object type.

validateObject

@Deprecated
void validateObject(DBObject original,
                               DBObject updated,
                               java.lang.String property)
                    throws ValidationException
Deprecated. use validateObjectProperty(DBObject,DBObject,Object)

Throws:
ValidationException

validateObjectProperty

void validateObjectProperty(DBObject original,
                            DBObject updated,
                            java.lang.String property)
                            throws ValidationException
Checks to see if the updated children of a given object are valid. If the object has no children of the given type a MissingValidatorException will be thrown. This is a convinience method to perform validation to a specific property on an object - all properties will be validated if validateObject(DBObject,DBObject) is called.

Parameters:
original - The original version of the edited object
updated - The edited object to validate
property - An identifier for a specific property to validate
Throws:
ValidationException - if the object is not valid. The exception will describe the validation failure. A MissingValidatorException is thrown if the provider has no validator for the given object type, or property.

validateObjectProperty

@Deprecated
void validateObjectProperty(DBObject original,
                                       DBObject updated,
                                       java.lang.Object property)
                            throws ValidationException
Deprecated. use validateObjectProperty(DBObject,DBObject,String)

Throws:
ValidationException

validateSchema

@Deprecated
void validateSchema(Schema schema)
                    throws ValidationException
Deprecated. use validateObject(DBObject object)

Checks to see if the Schema is valid.

Parameters:
schema - The Schema to validate
Throws:
ValidationException - if the Schema is not valid. The exception will describe the validation failure.

validateSchema

@Deprecated
void validateSchema(Schema original,
                               Schema updated)
                    throws ValidationException
Deprecated. use validateObject(DBObject original, DBObject updated)

Checks to see if the schema update is valid.

Parameters:
object - The original schema
object - The updated schema to validate
Throws:
ValidationException - if the updated schema is not valid. The exception will describe the validation failure.

getObject

<T extends SystemObject> T getObject(DBObjectCriteria<T> criteria)
                                 throws DBException
Retrieves the SystemObject representing a specific database object. The given criteria must match only one object.

Examples:

   // find EMP in a given provider and schema
   DBObjectProvider pro = ...
   Schema schema = ...
   SystemObject obj = pro.getObject(
     DBObjectCriteria.createCriteria( Table.TYPE, schema, "EMP" ) );

   // find Table HR.EMPLOYEES
   DBObjectCriteria c = new DBObjectCriteria
(Table.class); c.setNameLike( "EMPLOYEES" ); c.setSchemaName( "HR" ); Table employees = pro.getObject( c );

Parameters:
the - criteria to match the object required
Returns:
the SystemObject matching the specified criteria
Throws:
DBException - if an error is encountered retrieving the object

getObject

SchemaObject getObject(java.lang.String objectType,
                       Schema schema,
                       java.lang.String name)
                       throws DBException
Retrieves the SchemaObject representing a specific database object.

Parameters:
objectType - the type of object desired.
schema - the name of the schema containing the object
name - the name of the object
Returns:
the SchemaObject matching the specified criteria
Throws:
DBException - if an error is encountered retrieving the object
See Also:
DBObject.getType()

getObjectManager

@Deprecated
SchemaObjectManager getObjectManager()
Deprecated. use getCascadeManager()


getCascadeManager

CascadeManager getCascadeManager()
Gets the object for this provider that manages references between objects and how to cascade deletes between them.


getObjectFactory

DBObjectFactory getObjectFactory()
Get the object factory for this provider.


updateObjects

void updateObjects(Difference rs,
                   boolean replace,
                   boolean cascade)
                   throws DBException
Updates the definition of a set of objects. The changes required are described by the Difference which must have been created using the DiffEngine returned by getDiffEngine() The 'change' maybe to create, alter, or delete objects.

Parameters:
rs - the changes described as a Difference - this should be a LIST Difference with the old objects as a() and the new objects as b().
replace - true if an existing object is to be replaced (when creating)
cascade - true if cascade delete should be used to replace an object (when deleting)
Throws:
DBException

updateObject

void updateObject(SystemObject oldObject,
                  SystemObject newObject)
                  throws DBException
Updates the definition of an object.

Parameters:
oldObject - the old version of the object
newObject - the new version of the object
Throws:
DBException - if the update fails

updateObjects

void updateObjects(SystemObject[] oldObjects,
                   SystemObject[] newObjects)
                   throws DBException
Updates the definition of a set of objects.

Parameters:
oldObject - the old version of the objects
newObject - the new version of the objects
Throws:
DBException - if the update fails

listObjects

<T extends SystemObject> java.util.Collection<T> listObjects(DBObjectCriteria<T> filter)
                                                         throws DBException
Lists the objects from this provider that match the given criteria.

Examples:

   // list Tables beginning with E in a given schema
   DBObjectProvider pro = ...
   Schema schema = ...
   SystemObject obj = pro.listObjects(
     DBObjectCriteria.createCriteria( Table.TYPE, schema, "E%" ) );

   // list all objects that have columns and constraints in schema HR
   DBObjectCriteria c = new DBObjectCriteria(Relation.class);
   c.setSchemaName( "HR" );
   Collection rels = pro.listObjects( c );

   // list all the schemas in this provider
   Collection schemas = pro.listObjects(
      new DBObjectCriteria(Schema.class) );
 

Parameters:
filter - the filter to use for listing objects (cannot be null)
Returns:
a collection of objects
Throws:
DBException - if an error is encountered listing the objects

listObjects

java.lang.String[] listObjects(java.lang.String objectType,
                               Schema schema)
                               throws DBException
Lists the objects of a given type available from this provider.

Parameters:
objectType - the type of objects to list
schema - the schema to list from
Returns:
an array of object names
Throws:
DBException

listObjects

java.lang.String[] listObjects(java.lang.String objectType,
                               Schema schema,
                               java.lang.String ref)
                               throws DBException
Lists the objects of a given type available from this provider.

Parameters:
objectType - the type of objects to list
schema - the schema to list from
ref - a pattern to match against.
Returns:
an array of object names
Throws:
DBException

listObjects

SchemaObject[] listObjects(java.lang.String[] objectTypes,
                           Schema schema)
                           throws DBException
Lists the objects of multiple types available from this provider.

Parameters:
objectTypes - an array of Strings representing the desired types
schema - the Schema to list from
Returns:
an array of SchemaObjects representing the objects
Throws:
DBException - if an error is encountered listing the objects

listObjects

SchemaObject[] listObjects(java.lang.String[] objectTypes,
                           Schema schema,
                           java.lang.String ref)
                           throws DBException
Lists the objects of multiple types available from this provider.

Parameters:
objectTypes - an array of Strings representing the desired types
schema - the Schema to list from
ref - a pattern to match against.
Returns:
an array of SchemaObjects representing the objects
Throws:
DBException - if an error is encountered listing the objects

getTimestamp

java.lang.Long getTimestamp(java.lang.String objectType,
                            Schema schema,
                            java.lang.String name)
                            throws DBException
Retrieves the timestamp representing the last modification time of the specified object's metadata. If the provider does not provide timestamp information for metadata, a null value should be returned.

Parameters:
objectType - a String containing the type of the object
schema - the Schema containing the object
name - a String containing the name of the object
Returns:
the timestamp as a Long value
Throws:
DBException - if an error is encountered getting the timestamp

getTimestamp

java.lang.Long getTimestamp(DBObjectID id)
                            throws DBException
Retrieves the timestamp for the object represented by the given ID.

Parameters:
id - the ID for the object
Returns:
the timestamp
Throws:
DBException - if an error is encountered getting the timestamp
See Also:
getTimestamp(String,Schema,String)

listObjectTypes

java.lang.String[] listObjectTypes()
Lists the database object types supported by this DBObjectProvider. These types can then be used with listObjects to retrieve the objects of a given type.

Returns:
an array of strings containing the supported types of objects
See Also:
listObjects(oracle.javatools.db.DBObjectCriteria)

supportsObjectType

boolean supportsObjectType(java.lang.String type)
Convinience method to check whether this provider supports the given object type - i.e. whether it is contained in the array returned by listObjectTypes().

See Also:
listObjectTypes()

listSupportedDataTypes

DataType[] listSupportedDataTypes()
Retrieves the list of datatypes supported by this provider.

Returns:
an array of DataType objects representing the supported datatypes.

getDataType

DataType getDataType(java.lang.String typeName)
Retrieves the datatype represented by a specific name.

Parameters:
typeName - a String containing the name of the datatype.
Returns:
the DataType represented by the specified name or null if none can be found.

getOrCreateDataType

DataType getOrCreateDataType(java.lang.String typeName)
Retrieves the datatype represented by a specific name.

Parameters:
typeName - a String containing the name of the datatype.
Returns:
the DataType represented by the specified name. If none can be found, creates a UserDataType and registers this with the provider.

listSchemas

Schema[] listSchemas()
                     throws DBException
Retrieves the list of schemas available from this provider regardless of their visibility to the user.

Returns:
an array of schemas
Throws:
DBException
See Also:
listSchemas(boolean)

listSchemas

Schema[] listSchemas(boolean showAll)
                     throws DBException
Retrieves the list of schemas available from this provider. The list is optionally restricted to those schemas containing objects belonging (or visible to) the user.

Parameters:
showAll - if false, only schemas containing objects belonging to (or visible to) the user are returned
Returns:
an array of schemas
Throws:
DBException - if an error is encountered listing the schemas.

getSchema

Schema getSchema(java.lang.String name)
                 throws DBException
Retrieves the Schema object associated with a specific name.

Parameters:
name - a string containing the name of the schema
Returns:
a Schema representing the schema
Throws:
DBException - if an error is encountered getting the schema

getDefaultSchema

Schema getDefaultSchema()
                        throws DBException
Returns the default schema for the provider.

Throws:
DBException

createSchema

void createSchema(Schema schema,
                  boolean replace)
                  throws DBException
Causes the creation of a new Schema in the persistent storage.

Parameters:
schema - the schema being created
replace - whether to replace an existing schema
Throws:
DBException - if an error is encountered creating the schema

updateSchema

void updateSchema(Schema oldSchema,
                  Schema newSchema)
                  throws DBException
Updates the definition of a Schema.

Parameters:
oldSchema - the old version of the schema
newSchema - the new version of the schema
Throws:
DBException - if the update fails

deleteSchema

void deleteSchema(Schema schema,
                  boolean cascade)
                  throws DBException
Deletes the schema.

Parameters:
schema - the schema to delete
cascade - whether to delete dependent objects (i.e. all SchemaObjects contained in the Schema).
Throws:
DBException - if an error is encountered performing the delete

getDiffEngine

DiffEngine getDiffEngine()
Returns a diff engine setup with the appropriate set of differs for object updating.

Providers which do not support object updating should return null.


getPropertyManager

PropertyManager getPropertyManager()
Gets the PropertyManager (if available) for this provider. The property manager provides information about which properties are supported on which objects, and what operations (create/replace/update/delete) are supported for any particular object or property.

Returns:
this provider's property manager, or null if no property manager exists.

isEditable

boolean isEditable(DBObject object)
Returns whether or not the object can be edited


getDefaultTemplateForType

DBObject getDefaultTemplateForType(java.lang.String type)
Returns the default template object for the given type, or null if none defined


setDefaultTemplateForType

void setDefaultTemplateForType(java.lang.String type,
                               DBObject template)
Sets the default template object for the given type.


isNewFromTemplateType

boolean isNewFromTemplateType(java.lang.String type)
Test whether the given type is the pseudo type used for new objects that are being created from a template.

Parameters:
type - the type to test
Returns:
true if the type is a "new from template" type

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.