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

E13403-03

oracle.javatools.db
Class BaseObjectID

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObjectID
      extended by oracle.javatools.db.BaseObjectID
All Implemented Interfaces:
DBObjectID, Copyable
Direct Known Subclasses:
IdentifierBasedID, NameBasedID, ReferenceID

public abstract class BaseObjectID
extends AbstractDBObjectID

Base DBObjectID implementation that stores the object name and (optionally) schema name of the object. Inherits type and parent from AbstractDBObjectID.


Field Summary
static java.lang.String SEP
          The separator used when reading and writing the ID in string form.
static java.lang.String UNSPECIFIED_TYPE
          The for when toString is called on a typeless ID.
 
Constructor Summary
protected BaseObjectID()
           
protected BaseObjectID(DBObject obj, AbstractDBObjectProvider provider)
           
protected BaseObjectID(DBObject obj, DBObjectID parent)
           
protected BaseObjectID(java.lang.String type, AbstractDBObjectProvider provider)
           
protected BaseObjectID(java.lang.String type, DBObjectID parent)
           
 
Method Summary
protected  void clearToString()
           
abstract  void construct(java.lang.String id)
           
protected  void copyToImpl(BaseObjectID target)
           
static
<T extends BaseObjectID>
T
copyWithNewProvider(T id, AbstractDBObjectProvider pro)
          INTERNAL USE ONLY.
static BaseObjectID createFromString(java.lang.String idString)
          Creates a BaseObjectID from the information in the string.
protected  boolean equalsImpl(BaseObjectID target)
          Compares name, schema name and type (the latter using AbstractDBObjectID.equalsImpl(AbstractDBObjectID)).
 java.lang.String getName()
          Returns the name of the object this ID references.
 DBObjectProvider getProvider()
          INTERNAL USE ONLY.
Gets the provider this ID exists in.
 java.lang.String getSchemaName()
          If the referenced object is a SchemaObject, this returns the schema name for the object.
protected  boolean hasSameObjectName(BaseObjectID target)
           
protected  boolean hasSameProvider(BaseObjectID other)
           
static boolean isRecognizedType(java.lang.String id)
          Determines whether the given string starts with one of the identifiers.
 DBObject resolveID()
          Resolves the id into the object referenced.
 void setName(java.lang.String name)
          Sets the name of the object this ID references.
 void setParent(DBObjectID parent)
          Sets this id's parent id
 void setProvider(DBObjectProvider pro)
          INTERNAL USE ONLY.
Sets the provider this ID exists in.
protected  void setProviderImpl(AbstractDBObjectProvider pro)
          Directly sets the given provider without performing a check on the existing provider.
 void setSchema(Schema schema)
          Sets the "schemaName" property of this ID using the given Schema.
 void setSchemaName(java.lang.String name)
          Sets the schema name for the object.
 java.lang.String toString()
          Subclasses of this abstract ID must implement toString to return a String representation of the ID.
protected abstract  java.lang.String toStringImpl()
           
 
Methods inherited from class oracle.javatools.db.AbstractDBObjectID
copyToImpl, equals, equals, equalsImpl, equalsImpl, getParent, getType, hashCode, hasSameParent, resolveFromParent, resolveInParentObject, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.util.Copyable
copyTo
 

Field Detail

SEP

public static final java.lang.String SEP
The separator used when reading and writing the ID in string form.

See Also:
Constant Field Values

UNSPECIFIED_TYPE

public static final java.lang.String UNSPECIFIED_TYPE
The for when toString is called on a typeless ID. This should not really happen and is only in to keep the unit tests happy.

See Also:
Constant Field Values
Constructor Detail

BaseObjectID

protected BaseObjectID()

BaseObjectID

protected BaseObjectID(java.lang.String type,
                       DBObjectID parent)

BaseObjectID

protected BaseObjectID(java.lang.String type,
                       AbstractDBObjectProvider provider)

BaseObjectID

protected BaseObjectID(DBObject obj,
                       DBObjectID parent)

BaseObjectID

protected BaseObjectID(DBObject obj,
                       AbstractDBObjectProvider provider)
Method Detail

copyToImpl

protected void copyToImpl(BaseObjectID target)

toString

public final java.lang.String toString()
Description copied from class: AbstractDBObjectID
Subclasses of this abstract ID must implement toString to return a String representation of the ID. This is used for the hashCode. The toString() on two copies of the same ID must equate.

Specified by:
toString in class AbstractDBObjectID

toStringImpl

protected abstract java.lang.String toStringImpl()

construct

public abstract void construct(java.lang.String id)

clearToString

protected void clearToString()

resolveID

public DBObject resolveID()
                   throws DBException
Description copied from interface: DBObjectID
Resolves the id into the object referenced.

Returns:
the DBObject referenced by this DBObjectID
Throws:
DBException

getProvider

public final DBObjectProvider getProvider()
INTERNAL USE ONLY.
Gets the provider this ID exists in.

For internal use only. Application developers should not use this

setProvider

public final void setProvider(DBObjectProvider pro)
INTERNAL USE ONLY.
Sets the provider this ID exists in. This should never be called by client code, only used internally by the API.

For internal use only. Application developers should not use this

setProviderImpl

protected void setProviderImpl(AbstractDBObjectProvider pro)
Directly sets the given provider without performing a check on the existing provider. Deliberately protected as API callers should never need to call this directly. To create a copy of an ID intended for a new provider call copyWithNewProvider(T, oracle.javatools.db.AbstractDBObjectProvider).

See Also:
copyWithNewProvider(T, oracle.javatools.db.AbstractDBObjectProvider)

hasSameProvider

protected boolean hasSameProvider(BaseObjectID other)

setParent

public final void setParent(DBObjectID parent)
Description copied from class: AbstractDBObjectID
Sets this id's parent id

Overrides:
setParent in class AbstractDBObjectID

getSchemaName

public final java.lang.String getSchemaName()
If the referenced object is a SchemaObject, this returns the schema name for the object.


setSchemaName

public final void setSchemaName(java.lang.String name)
Sets the schema name for the object. Only necessary for SchemaObject references, if a parent ID for this object exists the schema name is not needed.


setSchema

public final void setSchema(Schema schema)
Sets the "schemaName" property of this ID using the given Schema.

Parameters:
schema - sets the schemaName for this object to be the name of the given schema. If null the schemaName property is set to null.

getName

public final java.lang.String getName()
Returns the name of the object this ID references.


setName

public final void setName(java.lang.String name)
Sets the name of the object this ID references.


equalsImpl

protected boolean equalsImpl(BaseObjectID target)
Compares name, schema name and type (the latter using AbstractDBObjectID.equalsImpl(AbstractDBObjectID)). Suclasses should call in their equalsImpl implementations where appropriate.


hasSameObjectName

protected boolean hasSameObjectName(BaseObjectID target)

copyWithNewProvider

public static <T extends BaseObjectID> T copyWithNewProvider(T id,
                                                             AbstractDBObjectProvider pro)
INTERNAL USE ONLY. Returns a copy of the given BaseObjectID with the new provider set. Useful for transferring objects or working with provider dependencies. If you make a copy of an ID then call setProvider() with a different provider, a WARNING message will get logged because changing providers is an illegal operation.

For internal use only. Application developers should not use this

createFromString

public static BaseObjectID createFromString(java.lang.String idString)
Creates a BaseObjectID from the information in the string. This information is of the form

Parameters:
idString - the ID in string form
Returns:

isRecognizedType

public static final boolean isRecognizedType(java.lang.String id)
Determines whether the given string starts with one of the identifiers. This is provided for migrated objects where the IDs may not have an identifier.

Parameters:
id -
Returns:
Unrecognized ID type. The ID will default to identifier-based

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

E13403-03

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