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

E13403-04

oracle.ide.db
Class SchemaObjectDescriptor

java.lang.Object
  extended by oracle.ide.db.SchemaObjectDescriptor

public class SchemaObjectDescriptor
extends java.lang.Object

An object to encapsulate information about a given schema object without actually retrieving the object from its given provider (e.g. the database). This is useful in import and generate operation where the details of the table to be (for example) imported are known, but it hasn't been retrieved from the database yet.

It is also useful for persisting information about a schema object for later retrieval back from its provider.

Finally it is also useful to use a descriptor when creating collections/maps of objects because the comparison only compares name, schema and type, and doesn't do a costly .equals on the object.

The class allows an extra name for the object to be recorded. This is useful for import processes that include the creation of entities/mappings etc.


Constructor Summary
SchemaObjectDescriptor(java.lang.String name, java.lang.String type, java.lang.String schema)
          Create a new descriptor for a given schema object.
SchemaObjectDescriptor(SystemObject obj)
          Create a descriptor for the given schema object.
 
Method Summary
 java.lang.Object copyTo(java.lang.Object obj)
           
protected  void copyToImpl(SchemaObjectDescriptor copy)
           
static SchemaObjectDescriptor[] createDescriptors(DBObjectID[] ids)
          Wraps up a set of DBObjectIDs into SchemaObjectDescriptors.
static SchemaObjectDescriptor[] createDescriptors(SchemaObject[] objs)
          Wraps up a set of SchemaObjects into SchemaObjectDescriptors.
static SchemaObjectDescriptor[] createDescriptors(SchemaObject[] objs, boolean saveObj)
          Wraps up a set of SchemaObjects into SchemaObjectDescriptors.
static SchemaObjectDescriptor[] createDescriptors(SystemObject[] objs)
          Wraps up a set of SystemObjects into SchemaObjectDescriptors.
static SchemaObjectDescriptor[] createDescriptors(SystemObject[] objs, boolean saveObj)
          Wraps up a set of SystemObjects into SchemaObjectDescriptors.
 boolean equals(java.lang.Object obj)
          Tests equality with another SchemaObjectDescriptor by comparing the name, type and schema.
 boolean equals(java.lang.Object obj, boolean strict)
          If strict is false performs a normal comparison of name, type and schema.
protected  boolean equalsImpl(SchemaObjectDescriptor obj, boolean strict)
           
 java.lang.String getName()
          Retrieves the name of the object.
 SystemObject getObject()
          If this is a wrapper for an existing object, this will return the object.
 java.lang.String getOriginalName()
          Deprecated. - use getName()
 java.lang.String getOtherName()
          Gets the other name stored in this descriptor - e.g.
 java.lang.String getSchema()
          Get the name of the schema for this schema object.
 java.lang.String getType()
          Get the type of this schema object.
 int hashCode()
           
 void setName(java.lang.String name)
          Change the name of this schema object.
 void setOriginalName(java.lang.String name)
          Deprecated. - use setName()
 void setOtherName(java.lang.String name)
          Sets the other name stored in this descriptor - e.g.
 void setSchema(java.lang.String schema)
          Sets the schema of the object.
 void setType(java.lang.String type)
          Sets the type of the object.
 java.lang.String toString()
          Uses the original name to provide a meanigful string to display in a shuttle.
 SchemaObject unwrapDescriptor(DBObjectProvider source)
           
static SchemaObject[] unwrapDescriptors(SchemaObjectDescriptor[] descs, DBObjectProvider source)
          Unwraps a set of descriptors and returns an array of SchemaObjects.
 SystemObject unwrapSystemObjectDescriptor(DBObjectProvider source)
           
static SystemObject[] unwrapSystemObjectDescriptors(SchemaObjectDescriptor[] descs, DBObjectProvider source)
          Unwraps a set of descriptors and returns an array of SystemObjects.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchemaObjectDescriptor

public SchemaObjectDescriptor(java.lang.String name,
                              java.lang.String type,
                              java.lang.String schema)
Create a new descriptor for a given schema object.

Parameters:
name - the name of the schema object
type - the type of the schema object
schema - the name of the schema that the object is from, or is destined to.

SchemaObjectDescriptor

public SchemaObjectDescriptor(SystemObject obj)
Create a descriptor for the given schema object. If this constructor is used for a handler operation then the object will be considered the appropriate source, and the provider will not be requeried for the object.

Parameters:
obj - the object to describe.
name - the new name of the object.
Method Detail

getName

public java.lang.String getName()
Retrieves the name of the object. If setName() has been called to change the name, the new name will be retrieved. The original name of the object can always be retrieved using getOriginalName().

Returns:
the name of the schema object.

getOriginalName

@Deprecated
public java.lang.String getOriginalName()
Deprecated. - use getName()

Get the name that the object was constructed with.


getType

public java.lang.String getType()
Get the type of this schema object.

Returns:

getSchema

public java.lang.String getSchema()
Get the name of the schema for this schema object.


getObject

public SystemObject getObject()
If this is a wrapper for an existing object, this will return the object. Otherwise it will return null. If you wish to ensure a returned object use unwrapDescriptor().


getOtherName

public java.lang.String getOtherName()
Gets the other name stored in this descriptor - e.g. entity name.


setName

public void setName(java.lang.String name)
Change the name of this schema object. This operation will not lose the original name - that can always be retrieved using getOriginalName().


setOriginalName

@Deprecated
public void setOriginalName(java.lang.String name)
Deprecated. - use setName()

Sets the original name of the object. Will not modify the underlying object if there is one. Used to create descriptors.


setType

public void setType(java.lang.String type)
Sets the type of the object. Will not modify the underlying object if there is one. Used to create descriptors.


setSchema

public void setSchema(java.lang.String schema)
Sets the schema of the object. Will not modify the underlying object if there is one. Used to create descriptors.


setOtherName

public void setOtherName(java.lang.String name)
Sets the other name stored in this descriptor - e.g. entity name.


equals

public boolean equals(java.lang.Object obj)
Tests equality with another SchemaObjectDescriptor by comparing the name, type and schema. The new name (if changed) is not compared.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with this
Returns:
equals if the objects have the same original name, type and schema.

equalsImpl

protected boolean equalsImpl(SchemaObjectDescriptor obj,
                             boolean strict)

equals

public boolean equals(java.lang.Object obj,
                      boolean strict)
If strict is false performs a normal comparison of name, type and schema. If strict is true this tests for equality on the original AND new names.


copyTo

public java.lang.Object copyTo(java.lang.Object obj)

copyToImpl

protected void copyToImpl(SchemaObjectDescriptor copy)

toString

public java.lang.String toString()
Uses the original name to provide a meanigful string to display in a shuttle.

Overrides:
toString in class java.lang.Object

unwrapDescriptor

public SchemaObject unwrapDescriptor(DBObjectProvider source)
                              throws DBException
Throws:
DBException

unwrapSystemObjectDescriptor

public SystemObject unwrapSystemObjectDescriptor(DBObjectProvider source)
                                          throws DBException
Throws:
DBException

unwrapDescriptors

public static SchemaObject[] unwrapDescriptors(SchemaObjectDescriptor[] descs,
                                               DBObjectProvider source)
                                        throws DBException
Unwraps a set of descriptors and returns an array of SchemaObjects. If an error is encountered unwrapping any object a DBException is thrown.

Throws:
DBException

unwrapSystemObjectDescriptors

public static SystemObject[] unwrapSystemObjectDescriptors(SchemaObjectDescriptor[] descs,
                                                           DBObjectProvider source)
                                                    throws DBException
Unwraps a set of descriptors and returns an array of SystemObjects. If an error is encountered unwrapping any object a DBException is thrown.

Throws:
DBException

createDescriptors

public static SchemaObjectDescriptor[] createDescriptors(SchemaObject[] objs,
                                                         boolean saveObj)
Wraps up a set of SchemaObjects into SchemaObjectDescriptors. Choose whether or not to save the object in the descriptor. The object may be from one provider, but we intend to use the descriptor to identify the object in another provider;


createDescriptors

public static SchemaObjectDescriptor[] createDescriptors(SystemObject[] objs,
                                                         boolean saveObj)
Wraps up a set of SystemObjects into SchemaObjectDescriptors. Choose whether or not to save the object in the descriptor. The object may be from one provider, but we intend to use the descriptor to identify the object in another provider;


createDescriptors

public static SchemaObjectDescriptor[] createDescriptors(SchemaObject[] objs)
Wraps up a set of SchemaObjects into SchemaObjectDescriptors.


createDescriptors

public static SchemaObjectDescriptor[] createDescriptors(SystemObject[] objs)
Wraps up a set of SystemObjects into SchemaObjectDescriptors.


createDescriptors

public static SchemaObjectDescriptor[] createDescriptors(DBObjectID[] ids)
Wraps up a set of DBObjectIDs into SchemaObjectDescriptors. The element in the returned array will be null if the corresponding id did not resolve or resolved to a DBObject that wasn't a SchemaObject.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

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.