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

E13403-02

oracle.jdeveloper.offlinedb
Class OfflineDBObjectFactory

java.lang.Object
  extended by oracle.jdeveloper.offlinedb.OfflineDBObjectFactory

public class OfflineDBObjectFactory
extends java.lang.Object

Factory class with methods for creating DBObjects for use in the offline API. All new objects are given appropriate offline object ids.

Individual methods, rather than a generic newDBObject() method that uses reflection, are given to give type safety to API user code, and to make it a bit quicker as well.


Nested Class Summary
static class OfflineDBObjectFactory.IDScheme
           
 
Constructor Summary
OfflineDBObjectFactory(OfflineDBObjectProvider pro)
          Constructor has package level access as API users should retrieve a factory from the provider, and not instantiate their own.
 
Method Summary
 void ensureID(java.util.Collection<? extends DBObject> objs, ResultSet rs)
          Checks that the given objects have an ID.
 DBObjectID ensureID(DBObject obj)
          Checks that the given object has an ID.
 DBObjectID ensureID(DBObject obj, boolean deep)
          Checks that the given object has an ID.
 DBObjectID ensureID(DBObject obj, boolean deep, boolean loadOnly)
          Same as ensureID(DBObject,boolean) but optionally specify that this is only a load operation and therefore heavier ID processing (such as updating the name information in the IDs) can be skipped.
 void ensureProvider(BaseObjectID id)
           
 CheckConstraint newCheckConstraint(java.lang.String name, Relation parent)
          Creates a new PKConstraint for the given Relation (ensuring that the Relation has a valid ID).
 Column newColumn(Relation parent)
          Creates a new Column with a unique offline id.
 Column newColumn(java.lang.String name, Relation parent)
          Creates a new Column with a unique offline id.
 FKConstraint newFKConstraint(java.lang.String name, Relation parent)
          Creates a new FKConstraint for the given Relation (ensuring that the Relation has a valid ID).
 Function newFunction()
          Deprecated. use newSchemaObject( Function.class )
 DBObjectID newID(DBObject obj)
          Creates a new ID for the given object and sets it too.
 DBObjectID newID(DBObject obj, DBObjectID parent)
          Creates a new ID for the given object and sets it too.
 IdentifierBasedID newID(java.lang.String type)
          Deprecated. 
 DBObjectID newID(java.lang.String type, IdentifierBasedID parent)
          Deprecated. 
 MaterializedView newMaterializedView()
          Deprecated. use newSchemaObject( MaterializedView.class )
 MaterializedViewLog newMaterializedViewLog()
          Deprecated. use newSchemaObject( MaterializedViewLog.class )
 ComplexType newObjectType()
          Deprecated. use newSchemaObject( ComplexType.class )
 Package newPackage()
          Deprecated. use newSchemaObject( Package.class )
 PKConstraint newPKConstraint(java.lang.String name, Relation parent)
          Creates a new PKConstraint for the given Relation (ensuring that the Relation has a valid ID).
 PlSql newPlSql(java.lang.String type)
          Returns a new PL/SQL object according to the type passed in
 Procedure newProcedure()
          Deprecated. use newSchemaObject( Table.class )
<T extends SchemaObject>
T
newSchemaObject(java.lang.Class<T> clz)
          Returns a new SchemaObject of given class setup with a unique offline id.
 Sequence newSequence()
          Deprecated. use newSchemaObject( Sequence.class )
 Synonym newSynonym()
          Deprecated. use newSchemaObject( Synonym.class )
 Table newTable()
          Deprecated. use newSchemaObject( Table.class )
 Table newTable(Table template)
          Deprecated. use the template support
 Trigger newTrigger()
          Deprecated. use newSchemaObject( Trigger.class )
 UniqueConstraint newUniqueConstraint(java.lang.String name, Relation parent)
          Creates a new UniqueConstraint for the given Relation (ensuring that the Relation has a valid ID).
 View newView()
          Deprecated. use newSchemaObject( View.class )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfflineDBObjectFactory

public OfflineDBObjectFactory(OfflineDBObjectProvider pro)
Constructor has package level access as API users should retrieve a factory from the provider, and not instantiate their own.

Method Detail

newID

@Deprecated
public IdentifierBasedID newID(java.lang.String type)
Deprecated. 

Returns a DBObjectID for the given object type setup for the offline database provider this factory is associated with.


newID

@Deprecated
public DBObjectID newID(java.lang.String type,
                                   IdentifierBasedID parent)
Deprecated. 

Returns a DBObjectID for the given object type and parent set up for the offline database provider this factory is associated with.


newID

public DBObjectID newID(DBObject obj)
Creates a new ID for the given object and sets it too. Will overwrite any existing ID.


newID

public DBObjectID newID(DBObject obj,
                        DBObjectID parent)
Creates a new ID for the given object and sets it too. Will overwrite any existing ID.


newSchemaObject

public <T extends SchemaObject> T newSchemaObject(java.lang.Class<T> clz)
Returns a new SchemaObject of given class setup with a unique offline id.

Returns:
a new offline schema object, or null if an object of that class cannot be instantiated.

newTable

@Deprecated
public Table newTable()
Deprecated. use newSchemaObject( Table.class )

Returns a new Table with a unique offline id.


newTable

@Deprecated
public Table newTable(Table template)
Deprecated. use the template support

USE WITH CAUTION - FINAL IMPLEMENTATION NOT YET DECIDED.
Returns a new Table using the given template Table, with a new unique offline id.
Currently just copies the columns.


newView

@Deprecated
public View newView()
Deprecated. use newSchemaObject( View.class )

Returns a new View with a unique offline id. Will contain an empty, declarative query.


newSequence

@Deprecated
public Sequence newSequence()
Deprecated. use newSchemaObject( Sequence.class )

Returns a new Sequence with a unique offline id.


newSynonym

@Deprecated
public Synonym newSynonym()
Deprecated. use newSchemaObject( Synonym.class )

Returns a new Synonym with a unique offline id.


newObjectType

@Deprecated
public ComplexType newObjectType()
Deprecated. use newSchemaObject( ComplexType.class )

Returns a new User-Defined Type with a unique offline id.


newProcedure

@Deprecated
public Procedure newProcedure()
Deprecated. use newSchemaObject( Table.class )

Returns a new Procedure with a unique offline id.


newFunction

@Deprecated
public Function newFunction()
Deprecated. use newSchemaObject( Function.class )

Returns a new Function with a unique offline id.


newTrigger

@Deprecated
public Trigger newTrigger()
Deprecated. use newSchemaObject( Trigger.class )

Returns a new Trigger with a unique offline id.


newMaterializedView

@Deprecated
public MaterializedView newMaterializedView()
Deprecated. use newSchemaObject( MaterializedView.class )

Returns a new Materialized View with a unique offline id.


newMaterializedViewLog

@Deprecated
public MaterializedViewLog newMaterializedViewLog()
Deprecated. use newSchemaObject( MaterializedViewLog.class )

Returns a new Materialized View Log with a unique offline id.


newPackage

@Deprecated
public Package newPackage()
Deprecated. use newSchemaObject( Package.class )

Returns a new Package with a unique offline id.


newPlSql

public PlSql newPlSql(java.lang.String type)
Returns a new PL/SQL object according to the type passed in

Parameters:
type - the type, e.g. Procedure.TYPE
Returns:
null, if the type is not recognized

newColumn

public Column newColumn(Relation parent)
Creates a new Column with a unique offline id.


newColumn

public Column newColumn(java.lang.String name,
                        Relation parent)
Creates a new Column with a unique offline id. The new column is automatically added to the Relation.


newUniqueConstraint

public UniqueConstraint newUniqueConstraint(java.lang.String name,
                                            Relation parent)
Creates a new UniqueConstraint for the given Relation (ensuring that the Relation has a valid ID).


newFKConstraint

public FKConstraint newFKConstraint(java.lang.String name,
                                    Relation parent)
Creates a new FKConstraint for the given Relation (ensuring that the Relation has a valid ID). Since 10.1.3 the new constraint is automatically added to the Relation.


newPKConstraint

public PKConstraint newPKConstraint(java.lang.String name,
                                    Relation parent)
Creates a new PKConstraint for the given Relation (ensuring that the Relation has a valid ID). Since 10.1.3 the new constraint is automatically added to the Relation.


newCheckConstraint

public CheckConstraint newCheckConstraint(java.lang.String name,
                                          Relation parent)
Creates a new PKConstraint for the given Relation (ensuring that the Relation has a valid ID). Since 10.1.3 the new constraint is automatically added to the Relation.


ensureID

public DBObjectID ensureID(DBObject obj)
Checks that the given object has an ID. Does not check an object's children.


ensureID

public void ensureID(java.util.Collection<? extends DBObject> objs,
                     ResultSet rs)
Checks that the given objects have an ID. AUTOMATICALLY RECURSES TO THE OBJECT'S CHILDREN.

For internal use only. Application developers should not use this

ensureID

public DBObjectID ensureID(DBObject obj,
                           boolean deep)
Checks that the given object has an ID. Will optionally recurse to any child objects to check them as well.
1) check that any parent is correctly setup with an ID
2) check that the object's ID is valid
3) check that any reference IDs are valid (e.g. FK, Synonym)
4) optionally recurse to child objects
Returns null if the object is a sql fragment


ensureID

public DBObjectID ensureID(DBObject obj,
                           boolean deep,
                           boolean loadOnly)
Same as ensureID(DBObject,boolean) but optionally specify that this is only a load operation and therefore heavier ID processing (such as updating the name information in the IDs) can be skipped.


ensureProvider

public void ensureProvider(BaseObjectID id)

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

E13403-02

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