Skip navigation links

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

E17062-03


oracle.odi.dataservices.fwk
Class ManagedEntity

java.lang.Object
  extended by oracle.odi.dataservices.fwk.ManagedEntity


public class ManagedEntity
extends java.lang.Object

A data service parameter that represents the entity corresponding to one record of the datastore handled by the data service. This class can be used as a valid input or output parameter of a data service method. It represents one record of the datastore for which service has been generated. For example, for a SALES_CUSTOMERS table this class will represent a customer record.

A managed entity contains a set of columns usually identified by their names. These are the Defined Columns. When a column is set to a value, even a null value, it is considered as defined. A column that is considered as undefined (because it has been removed using removeColumn, or because it was not present in the original resultset) is usually not taken into account in changes to the datastore behind the ManagedEntity. In the case of an RDBMS table for example, the column should not appear in any INSERT/UPDATE statements, and will take a default value. Undefined columns correspond to optional elements in a SOAP envelope that are not defined.


Constructor Summary
ManagedEntity()
          Constructs a new ManagedEntity object.

 

Method Summary
 void assertColsDefined(java.util.List pColumnsName)
          Asserts that all columns in the list of column names pColumnsName have been defined.
static ManagedEntity createFromResultSet(java.sql.ResultSet pResultSet, java.util.List pColumnsList)
          Helper method used to create a ManagedEntity from a JDBC ResultSet object.
This method creates a new ManagedEntity and sets its columns' values to those from the ResultSet.
 java.lang.Object getColumnValue(java.lang.String pColumnName)
          Returns the value of a column specified by its name.
 java.util.List getDefinedColumns()
          Returns the list of columns defined for the ManagedEntity.
 java.util.List getDefinedColumns(java.util.List pColumnList)
          Returns the columns in pColumnList that are defined.
 boolean isColumnDefined(java.lang.String pColumnName)
          Checks whether a column, specified by name, has been defined.
 void removeColumn(java.lang.String pColumnName)
          Removes the specified column from the defined columns.
 void setColumnValue(java.lang.String pColumnName, java.lang.Object pValue)
          Sets the value of a column specified by name.
 java.lang.String toString()
           

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ManagedEntity

public ManagedEntity()
Constructs a new ManagedEntity object. This managed entity has no defined columns .

Method Detail

assertColsDefined

public void assertColsDefined(java.util.List pColumnsName)
                       throws InvalidInputMessageException
Asserts that all columns in the list of column names pColumnsName have been defined.
Parameters:
pColumnsName - list of column names.
Throws:
InvalidInputMessageException - if not all columns have been defined

getDefinedColumns

public java.util.List getDefinedColumns()
Returns the list of columns defined for the ManagedEntity.
Returns:
List of defined column names

getDefinedColumns

public java.util.List getDefinedColumns(java.util.List pColumnList)
Returns the columns in pColumnList that are defined.
Parameters:
pColumnList - list of columns names to check
Returns:
List of defined column names

isColumnDefined

public boolean isColumnDefined(java.lang.String pColumnName)
Checks whether a column, specified by name, has been defined.
Parameters:
pColumnName - the column name
Returns:
True if the column is defined.

getColumnValue

public java.lang.Object getColumnValue(java.lang.String pColumnName)
Returns the value of a column specified by its name.
Parameters:
pColumnName - the column name.
Returns:
The column value. Returns null if the column is defined and set to a null value, or if the column is undefined. You should use isColumnDefined to check whether the column is defined or not.
See Also:
setColumnValue(java.lang.String, java.lang.Object)

setColumnValue

public void setColumnValue(java.lang.String pColumnName,
                           java.lang.Object pValue)
Sets the value of a column specified by name. A column set this way is automatically considered to be defined.
Parameters:
pColumnName - the column name.
pValue - the column value.
See Also:
getColumnValue(java.lang.String)

removeColumn

public void removeColumn(java.lang.String pColumnName)
Removes the specified column from the defined columns.
Parameters:
pColumnName - the column name

createFromResultSet

public static ManagedEntity createFromResultSet(java.sql.ResultSet pResultSet,
                                                java.util.List pColumnsList)
                                         throws java.sql.SQLException
Helper method used to create a ManagedEntity from a JDBC ResultSet object.
This method creates a new ManagedEntity and sets its columns' values to those from the ResultSet. The values of the columns listed in pColumnsList are added to the fields of the ManagedEntity.
Parameters:
pResultSet - the ResultSetfrom which to retrieve the data
pColumnsList - the list of columns to set in the ManagedEntity
Returns:
null if pResultSet.next() returns false; a ManagedEntity otherwise
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Skip navigation links

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

E17062-03


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