Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

oracle.odi.domain.model
Class OdiKey

java.lang.Object
  extended by oracle.odi.domain.support.BusinessObject
      extended by oracle.odi.domain.support.AbstractRepositoryEntity
          extended by oracle.odi.domain.support.AbstractOdiEntity
              extended by oracle.odi.domain.model.OdiKey
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IOdiEntity, IRepositoryEntity, IWorkDevelopmentOdiEntity, IKey<OdiColumn>

public class OdiKey
extends oracle.odi.domain.support.AbstractOdiEntity
implements IKey<OdiColumn>, IWorkDevelopmentOdiEntity

A key for an OdiDataStore.

The type of key (i.e. Primary Key, Alternative Key or Index) can be controlled using the type safe enum OdiKey.KeyType and the method setKeyType(oracle.odi.domain.model.OdiKey.KeyType).

Since:
11.1.1.3.0
See Also:
Serialized Form

Nested Class Summary
static class OdiKey.KeyType
          Defines the type of an OdiKey instance.
 
Field Summary
static int NAME_MAX_LENGTH
          Maximum length supported for the "name" property.
 
Fields inherited from class oracle.odi.domain.support.AbstractOdiEntity
STARTING_INTERNAL_VERSION
 
Constructor Summary
OdiKey(OdiDataStore pDataStore, java.lang.String pName)
          Construct a new OdiKey.
 
Method Summary
 void addColumn(OdiColumn pColumn)
          Adds the given column to this OdiKey instance.
 java.util.List<OdiColumn> getColumns()
          Returns an unmodifiable list of the columns that are part of this key.
 OdiDataStore getDataStore()
          Returns the OdiDataStore this OdiKey belongs to.
 java.io.Serializable getInternalId()
          Provides a common getter for the persistence layer to obtain an identity, irrespective of the actual type of identity used.
 java.lang.Number getKeyId()
          Returns the internal identifier of this OdiKey instance.
 OdiKey.KeyType getKeyType()
          Returns the OdiKey.KeyType of this OdiKey instance.
 java.lang.String getName()
          Returns the name of this OdiKey instance.
 IRepositoryEntity getSecurityContainer()
          Define a generic way to retrieve container for entities.
 boolean isActive()
          Returns whether this key is active (enabled) or not in the database.
 boolean isFlowCheckEnabled()
          Returns whether the flow check is enabled for this key, or not.
 boolean isInDatabase()
          Returns whether this key is implemented in database or not.
 boolean isStaticCheckEnabled()
          Returns whether the static check is enabled for this key, or not.
 void removeColumn(OdiColumn pColumn)
          Remove the the given column from this key.
 void setActive(boolean pActive)
          Defines whether this key is active (enabled) or inactive (disabled) in the database.
 void setFlowCheckEnabled(boolean pFlowCheckEnabled)
          Defines whether the flow check is enabled for this key, or not.
 void setInDatabase(boolean pInDatabase)
          Defines whether this key is implemented in database or not.
 void setKeyType(OdiKey.KeyType pKeyType)
          Sets the OdiKey.KeyType for this OdiKey.
 void setStaticCheckEnabled(boolean pStaticCheckEnabled)
          Defines whether the static check is enabled for this key, or not.
 
Methods inherited from class oracle.odi.domain.support.AbstractOdiEntity
equals, getFirstDate, getFirstUser, getInternalVersion, getLastDate, getLastUser, hashCode, isInstanceLevelSecurityNeeded, isNew, toString
 
Methods inherited from class oracle.odi.domain.support.BusinessObject
clone
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.odi.domain.IOdiEntity
getFirstDate, getFirstUser, getLastDate, getLastUser, isInstanceLevelSecurityNeeded
 

Field Detail

NAME_MAX_LENGTH

public static final int NAME_MAX_LENGTH
Maximum length supported for the "name" property.

See Also:
OdiKey(OdiDataStore, String), Constant Field Values
Constructor Detail

OdiKey

public OdiKey(OdiDataStore pDataStore,
              java.lang.String pName)
Construct a new OdiKey.

This constructor sets the parent OdiDataStore and the name of this OdiKey instance.

Parameters:
pDataStore - the datastore this key belongs to.
pName - the name of this key
Throws:
java.lang.IllegalArgumentException - if the datastore is null or if the name is null, empty or longer than 128
Method Detail

addColumn

public void addColumn(OdiColumn pColumn)
Adds the given column to this OdiKey instance.

This makes the given column participating in this key object at last position index.

Parameters:
pColumn - the column to add
Throws:
java.lang.IllegalArgumentException - if pColumn is null or does not belong to the OdiDataStore to which this key belongs.
See Also:
getColumns(), removeColumn(OdiColumn)

getColumns

public java.util.List<OdiColumn> getColumns()
Returns an unmodifiable list of the columns that are part of this key.

The returned list is ordered by columns' position in this key object.

Specified by:
getColumns in interface IKey<OdiColumn>
Returns:
an unmodifable List of OdiColumn
See Also:
addColumn(OdiColumn), removeColumn(OdiColumn)

getDataStore

public OdiDataStore getDataStore()
Returns the OdiDataStore this OdiKey belongs to.

Returns:
the parent datastore.

getInternalId

public java.io.Serializable getInternalId()
Description copied from interface: IRepositoryEntity
Provides a common getter for the persistence layer to obtain an identity, irrespective of the actual type of identity used.

Typically a subclass will delegate to a public SomePrimitiveWrapper getId() method. The necessity for the getInternalId() abstract method is solely because the persistence layer needs a way of obtaining the identity irrespective of the actual identity implementation choice.

Returning null from this method will indicate the object has never been saved. This will likely be relied on by some DAO implementations.

Specified by:
getInternalId in interface IRepositoryEntity
Returns:
the persistence identity of this instance

getKeyId

public java.lang.Number getKeyId()
Returns the internal identifier of this OdiKey instance.

Returns:
the internal ID.

getKeyType

public OdiKey.KeyType getKeyType()
Returns the OdiKey.KeyType of this OdiKey instance.

Returns:
the key type
See Also:
setKeyType(KeyType)

getName

public java.lang.String getName()
Returns the name of this OdiKey instance.

Specified by:
getName in interface IOdiEntity
Specified by:
getName in interface IKey<OdiColumn>
Overrides:
getName in class oracle.odi.domain.support.AbstractOdiEntity
Returns:
the name

getSecurityContainer

public IRepositoryEntity getSecurityContainer()
Description copied from interface: IRepositoryEntity
Define a generic way to retrieve container for entities.

Specified by:
getSecurityContainer in interface IRepositoryEntity
Returns:
container entity

isActive

public boolean isActive()
Returns whether this key is active (enabled) or not in the database.

Returns:
true if the key is active, false otherwise
See Also:
setActive(boolean)

isFlowCheckEnabled

public boolean isFlowCheckEnabled()
Returns whether the flow check is enabled for this key, or not.

Returns:
true if enabled, false otherwise
See Also:
setFlowCheckEnabled(boolean)

isInDatabase

public boolean isInDatabase()
Returns whether this key is implemented in database or not.

Returns:
true if this key is defined as implemented database, false otherwise.
See Also:
setInDatabase(boolean)

isStaticCheckEnabled

public boolean isStaticCheckEnabled()
Returns whether the static check is enabled for this key, or not.

Returns:
true if enabled, false otherwise
See Also:
setStaticCheckEnabled(boolean)

removeColumn

public void removeColumn(OdiColumn pColumn)
Remove the the given column from this key.

This makes the given column to do not participate to this key object anymore. Positions of each columns in this key will be rearranged accordingly.

Parameters:
pColumn - the column to remove from this key
Throws:
java.lang.IllegalArgumentException - if the column is null or is not part of this key
See Also:
getColumns(), addColumn(OdiColumn)

setActive

public void setActive(boolean pActive)
Defines whether this key is active (enabled) or inactive (disabled) in the database.

By default, this property is set to true.

Parameters:
pActive - true to make this key enabled, false to make it disabled
See Also:
isActive()

setFlowCheckEnabled

public void setFlowCheckEnabled(boolean pFlowCheckEnabled)
Defines whether the flow check is enabled for this key, or not.

By default, this property is set to true.

Parameters:
pFlowCheckEnabled - true if enabled, false otherwise
See Also:
isFlowCheckEnabled()

setInDatabase

public void setInDatabase(boolean pInDatabase)
Defines whether this key is implemented in database or not.

By default, this property is set to false.

Parameters:
pInDatabase - true if this key is implemented in database, false otherwise
See Also:
isInDatabase()

setKeyType

public void setKeyType(OdiKey.KeyType pKeyType)
                throws java.lang.IllegalArgumentException
Sets the OdiKey.KeyType for this OdiKey.

By default, the type of an OdiKey is set to OdiKey.KeyType.ALTERNATE_KEY.

Parameters:
pKeyType - the type of the key
Throws:
java.lang.IllegalArgumentException - if the given parameter is null or if trying to set to PRIMARY_KEY and datastore already has a PK
See Also:
getKeyType()

setStaticCheckEnabled

public void setStaticCheckEnabled(boolean pStaticCheckEnabled)
Defines whether the static check is enabled for this key, or not.

By default, this property is set to true.

Parameters:
pStaticCheckEnabled - true if enabled, false otherwise
See Also:
isStaticCheckEnabled()

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.