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

E17060-01

oracle.odi.domain.project
Class OdiVariable

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.project.OdiVariable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IExportable, IOdiEntity, IRepositoryEntity, IWorkDevelopmentOdiEntity, IOdiScenarioSource

public class OdiVariable
extends oracle.odi.domain.support.AbstractOdiEntity
implements IOdiScenarioSource, IWorkDevelopmentOdiEntity, IExportable

Represents design time metadata about a variable.

OdiVariable class is the only member of OdiVariable aggregate, thus it is the root entity and implements IOdiEntity interface. An OdiVariable has an ID that can be obtained from getVariableId() method call. This ID is assigned when an OdiVariable is stored in design time repository. This ID represents the identity of an OdiVariable. Equals / hashCode method are implemented according this identity.

There is two distinct scopes of OdiVariable: Global and Project.

Scope of an OdiVariable cannot be changed.

Life cycle of an OdiVariable begins at design time when it is created from one of its constructors, or when imported from external XML file. It is then typically stored inside ODI design time repository. The users can modify it in order to make it fit their needs. Life cycle ends when a user remove the OdiVariable instance from design time repository, or if enclosing OdiProject is removed (Project Scope).

Since:
11.1.1.3.0
See Also:
Serialized Form

Nested Class Summary
static class OdiVariable.Action
          Defines the type of persistence to be applied to an OdiVariable's value at runtime.
static class OdiVariable.DataType
          Defines the data type of an OdiVariable.
 
Field Summary
static int NAME_MAX_LENGTH
          OdiVariable's name maximum length.
 
Fields inherited from class oracle.odi.domain.support.AbstractOdiEntity
STARTING_INTERNAL_VERSION
 
Constructor Summary
OdiVariable(OdiProject pProject, java.lang.String pName)
          Construct a new OdiVariable with the given name owned by the given OdiProject.
OdiVariable(java.lang.String pName)
          Construct a new global (i.e.
 
Method Summary
 OdiVariable.Action getAction()
          Returns the values storage strategy for this OdiVariable instance.
 OdiVariable.DataType getDataType()
          Returns the OdiVariable.DataType defined on this OdiVariable instance.
 java.lang.Object getDefaultValue()
          Returns the current value of this OdiVariable instance.
 java.lang.String getDescription()
          Returns the description of this OdiVariable instance.
 java.io.Serializable getInternalId()
          Provides a common getter for the persistence layer to obtain an identity, irrespective of the actual type of identity used.
 OdiLogicalSchema getLogicalSchema()
          Returns the OdiLogicalSchema used for the refresh of this OdiVariable instance values.
 java.lang.String getName()
          Returns the name of this OdiVariable instance.
 OdiProject getProject()
          Returns the OdiProject that owns this OdiVariable instance.
 Expression getRefreshQuery()
          Returns the SQL expression used to refresh this OdiVariable instance value.
 IRepositoryEntity getSecurityContainer()
          Define a generic way to retrieve container for entities.
 java.lang.Number getVariableId()
          Returns this OdiVariable instance identifier.
 boolean isGlobal()
          Returns whether this OdiVariable is global, or not (i.e.
 boolean isInstanceLevelSecurityNeeded()
          Internal: this method is for internal purpose and must not be considered as part of the public API.
 void setAction(OdiVariable.Action pAction)
          Defines the value storage strategy for this OdiVariable instance.
 void setDataType(OdiVariable.DataType pDatatype)
          Defines the data type of this OdiVariable instance.
 void setDefaultValue(java.lang.Object pValue)
          Defines the default value of this OdiVariable instance.
 void setDescription(java.lang.String pDescription)
          Defines a description for this OdiVariable instance.
 void setLogicalSchema(OdiLogicalSchema pOdiLogicalSchema)
          Defines the logical schema used to refresh this variable's value.
 void setRefreshQuery(Expression pSqlExpression)
          Sets the SQL expression used to refresh this OdiVariable instance value against an OdiLogicalSchema defined using the setLogicalSchema(OdiLogicalSchema) method.
 
Methods inherited from class oracle.odi.domain.support.AbstractOdiEntity
equals, getFirstDate, getFirstUser, getInternalVersion, getLastDate, getLastUser, hashCode, 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
 

Field Detail

NAME_MAX_LENGTH

public static final int NAME_MAX_LENGTH
OdiVariable's name maximum length.

See Also:
Constant Field Values
Constructor Detail

OdiVariable

public OdiVariable(OdiProject pProject,
                   java.lang.String pName)
Construct a new OdiVariable with the given name owned by the given OdiProject.

Parameters:
pProject - the owning project
pName - the name of the variable
Throws:
java.lang.IllegalArgumentException - if the name is null, empty or longer than NAME_MAX_LENGTH
See Also:
NAME_MAX_LENGTH

OdiVariable

public OdiVariable(java.lang.String pName)
Construct a new global (i.e. without any enclosing project) OdiVariable with the given name.

Parameters:
pName - the name of the variable
Throws:
java.lang.IllegalArgumentException - if the name is null, empty or longer than 400
See Also:
NAME_MAX_LENGTH
Method Detail

getAction

public OdiVariable.Action getAction()
Returns the values storage strategy for this OdiVariable instance. It can't be null.

Returns:
an OdiVariable.Action instance
See Also:
setAction(Action)

getDataType

public OdiVariable.DataType getDataType()
Returns the OdiVariable.DataType defined on this OdiVariable instance.

Returns:
this variable's data type
See Also:
setDataType(DataType)

getDefaultValue

public java.lang.Object getDefaultValue()
Returns the current value of this OdiVariable instance.

The actual class of returned object depends on this variable's value type.

Returns:
this variable's default value
See Also:
setDefaultValue(Object), getDataType()

getDescription

public java.lang.String getDescription()
Returns the description of this OdiVariable instance.

Returns:
this variable's description
See Also:
setDescription(String)

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

getLogicalSchema

public OdiLogicalSchema getLogicalSchema()
Returns the OdiLogicalSchema used for the refresh of this OdiVariable instance values.

Returns:
this variable's logical schema, or null if none.
See Also:
setLogicalSchema(OdiLogicalSchema)

getName

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

Specified by:
getName in interface IOdiEntity
Overrides:
getName in class oracle.odi.domain.support.AbstractOdiEntity
Returns:
this variable's name
See Also:
setName(String)

getProject

public OdiProject getProject()
Returns the OdiProject that owns this OdiVariable instance.

Returns:
the project this variable belongs to, or null if none.
See Also:
isGlobal()

getRefreshQuery

public Expression getRefreshQuery()
Returns the SQL expression used to refresh this OdiVariable instance value.

Returns:
this variable's refresh query, or null
See Also:
getLogicalSchema(), setLogicalSchema(OdiLogicalSchema), setRefreshQuery(Expression)

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

getVariableId

public java.lang.Number getVariableId()
Returns this OdiVariable instance identifier.

Returns:
this variable's ID

isGlobal

public boolean isGlobal()
Returns whether this OdiVariable is global, or not (i.e. whether there is a owning OdiProject or not).

Returns:
true if this variable is global, false otherwise

isInstanceLevelSecurityNeeded

public boolean isInstanceLevelSecurityNeeded()
Description copied from interface: IOdiEntity
Internal: this method is for internal purpose and must not be considered as part of the public API.

Defines a method to capture the info on which object needs instance level privilege.

Specified by:
isInstanceLevelSecurityNeeded in interface IOdiEntity
Overrides:
isInstanceLevelSecurityNeeded in class oracle.odi.domain.support.AbstractOdiEntity
Returns:
true if instance level security needed, false otherwise

setAction

public void setAction(OdiVariable.Action pAction)
Defines the value storage strategy for this OdiVariable instance. By default, the action is defined with the enum value OdiVariable.Action.HISTORIZE.

Parameters:
pAction - the action of this variable
See Also:
getAction()

setDataType

public void setDataType(OdiVariable.DataType pDatatype)
Defines the data type of this OdiVariable instance. Default value is OdiVariable.DataType.SHORT_TEXT.

Parameters:
pDatatype - the data type
Throws:
java.lang.IllegalArgumentException - if the parameter is null;
See Also:
getDataType()

setDefaultValue

public void setDefaultValue(java.lang.Object pValue)
Defines the default value of this OdiVariable instance. The specified value's type must be in accordance with the OdiVariable.DataType enum value.

Parameters:
pValue - the value to set.
Throws:
java.lang.IllegalArgumentException - if the given value is not consistent with this variable's data type
See Also:
getDataType(), getDefaultValue()

setDescription

public void setDescription(java.lang.String pDescription)
Defines a description for this OdiVariable instance.

Parameters:
pDescription - the description
See Also:
getDescription()

setLogicalSchema

public void setLogicalSchema(OdiLogicalSchema pOdiLogicalSchema)
Defines the logical schema used to refresh this variable's value.

Parameters:
pOdiLogicalSchema - the logical schema
See Also:
setRefreshQuery(Expression), getRefreshQuery(), getLogicalSchema()

setRefreshQuery

public void setRefreshQuery(Expression pSqlExpression)
Sets the SQL expression used to refresh this OdiVariable instance value against an OdiLogicalSchema defined using the setLogicalSchema(OdiLogicalSchema) method.

Parameters:
pSqlExpression - the refresh query
See Also:
setLogicalSchema(OdiLogicalSchema), getLogicalSchema(), getRefreshQuery()

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.