Skip navigation links

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

E17060-03


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, IFlexFieldUser, IOdiEntity, IRepositoryEntity, IWorkDevelopmentOdiEntity, IKey<OdiColumn>

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

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.util.Collection<IFlexFieldValue> getFlexFieldsValues()
          Obtains flex fields values related to this IFlexFieldUser.
 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.
 void initFlexFields(IOdiFlexFieldFinder pOdiFlexFieldFinder)
          Initialize flex fields related to this IFlexFieldUser.
 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 moveColumn(OdiColumn pColumn, int pNewPosition)
          Sets a new Position for the given column of this key.
 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:
DomainRuntimeException - if the datastore is null or if the name is null, empty or longer than 128

Method Detail

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.

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

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)

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()

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)

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()

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

getDataStore

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

getKeyType

public OdiKey.KeyType getKeyType()
Returns the OdiKey.KeyType of this OdiKey instance.
Returns:
the key type
See Also:
setKeyType(KeyType)

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:
DomainRuntimeException - if the given parameter is null or if trying to set to PRIMARY_KEY and datastore already has a PK
java.lang.IllegalArgumentException
See Also:
getKeyType()

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)

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()

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)

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()

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)

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:
DomainRuntimeException - if pColumn is null or does not belong to the OdiDataStore to which this key belongs.
See Also:
getColumns(), removeColumn(OdiColumn)

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:
DomainRuntimeException - if the column is null or is not part of this key
See Also:
getColumns(), addColumn(OdiColumn)

getFlexFieldsValues

public java.util.Collection<IFlexFieldValue> getFlexFieldsValues()
Description copied from interface: IFlexFieldUser
Obtains flex fields values related to this IFlexFieldUser.
Specified by:
getFlexFieldsValues in interface IFlexFieldUser
Returns:
an unmodifiable Collection of flex field values
Since:
11.1.1.5.0

initFlexFields

public void initFlexFields(IOdiFlexFieldFinder pOdiFlexFieldFinder)
Description copied from interface: IFlexFieldUser
Initialize flex fields related to this IFlexFieldUser.
Specified by:
initFlexFields in interface IFlexFieldUser
Parameters:
pOdiFlexFieldFinder - OdiFlexField finder to be used to query flex fields
Since:
11.1.1.5.0

moveColumn

public void moveColumn(OdiColumn pColumn,
                       int pNewPosition)
Sets a new Position for the given column of this key.
Parameters:
pColumn - the column to change position to
pNewPosition - the new position
Throws:
DomainRuntimeException - if the column is null or not present in the key or if the new position is not valid
Since:
11.1.1.5.0
See Also:
getColumns(), addColumn(OdiColumn), removeColumn(OdiColumn)

Skip navigation links

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

E17060-03


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