Oracle Fusion Middleware extensions for Seed Data Framework
11g Release 1 (11.1.2)

E22564-02

oracle.apps.fnd.applseed.rt.common.mapper
Class ReferenceUtil

java.lang.Object
  extended by oracle.apps.fnd.applseed.rt.common.mapper.ReferenceUtil

public class ReferenceUtil
extends java.lang.Object

This class is intended to serve as a utility class for dealing with references. All the methods in this class are supposed to be static.

Since:
drop 6
Version:
$Header: atgpf/applseed/src/java/oracle/apps/fnd/applseed/rt/common/mapper/ReferenceUtil.java /main/38 2010/10/26 06:34:17 aksinha Exp $
Author:
sjanarth

Constructor Summary
ReferenceUtil()
           
 
Method Summary
static boolean areViewObjectsCompatible(oracle.jbo.ViewObject srcVO, oracle.jbo.ViewObject destVO)
          check if the primary keys of the view object match, if yes return true
static oracle.jbo.ViewCriteria constructViewCriteria(oracle.jbo.ViewObject vo, java.util.List<oracle.jbo.AttributeDef> attrs, oracle.jbo.Row row, SDMappedUsage mappedUsage)
          creates the view criteria on the key attributes with values from the given row
static oracle.jbo.ViewCriteria constructViewCriteria(oracle.jbo.ViewObject vo, oracle.jbo.ViewObject destVO, oracle.jbo.Row row)
          Constructs a view criteria using the key attributes from a given View object and values from the given row
static java.lang.String getAttributeValueFromVO(SDViewNode startNode, oracle.jbo.ViewObject destinationVO, java.lang.String attr, oracle.jbo.Row r)
          Find the given attribute value from the given VO by reverse traversing In case it is internal reference then it creates new VO's and uses them
static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromCurrentRow(SDViewNode node)
          This method returns all the key attribute values for the given node.
static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromCurrentRow(SDViewNode node, boolean includeRootPartitionKey)
           
static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromGivenRow(SDViewNode node, oracle.jbo.Row row)
          This method returns the key attributes values for a given node from the given row The remaining behaviour is same as the getKeyValuesFromCurrentRow method
static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromRowNoParents(SDViewNode node, oracle.jbo.Row row)
          Get the Row key values, with Surrogates, Foreign Keys, and LOVs dereferenced as needed for Upload.
static java.util.Map<java.lang.String,java.lang.Object> getKeyValuesFromXML(SDViewNode node, SDDataEntity de, boolean isMandatory)
           
static java.lang.String getPartitionKeyValue(SDReferenceUsage refUsage, oracle.jbo.Row row)
          For a given Reference Usage and the row of the source node, will find the partition key attribute value
static boolean lookupEntity(SDViewNode destNode, java.util.Map<java.lang.String,java.lang.Object> altKey, SDDataEntity de)
           
static boolean validateDEData(oracle.jbo.ViewObject vo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceUtil

public ReferenceUtil()
Method Detail

getKeyValuesFromRowNoParents

public static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromRowNoParents(SDViewNode node,
                                                                                                      oracle.jbo.Row row)
                                                                                               throws SDRuntimeException
Get the Row key values, with Surrogates, Foreign Keys, and LOVs dereferenced as needed for Upload. Duplication of getKeyValuesFromRow, just don't include any parental keys in return list. Returned map will not contain DE keys, caller expected to supply them if needed.

Parameters:
node - SDViewNode
row - Row
Returns:
LinkedHashMap of derefed key name to value pairs, without parental keys or DE keys
Throws:
SDRuntimeException

getKeyValuesFromCurrentRow

public static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromCurrentRow(SDViewNode node,
                                                                                                    boolean includeRootPartitionKey)
                                                                                             throws SDRuntimeException
Throws:
SDRuntimeException

getKeyValuesFromCurrentRow

public static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromCurrentRow(SDViewNode node)
                                                                                             throws SDRuntimeException
This method returns all the key attribute values for the given node. Assumes the given view node points to its current row. If the key attributes involve references, it pulls them all out by looking them up from the database.

Parameters:
node - SDViewNode
Returns:
Hash of key and Value of all key attribiutes , key would be preepended with VO Name for reference attributes Result would not contain the partition attribute
Throws:
SDRuntimeException

getKeyValuesFromGivenRow

public static java.util.LinkedHashMap<java.lang.String,java.lang.Object> getKeyValuesFromGivenRow(SDViewNode node,
                                                                                                  oracle.jbo.Row row)
                                                                                           throws SDRuntimeException
This method returns the key attributes values for a given node from the given row The remaining behaviour is same as the getKeyValuesFromCurrentRow method

Parameters:
node -
row -
Returns:
Throws:
SDRuntimeException

getKeyValuesFromXML

public static java.util.Map<java.lang.String,java.lang.Object> getKeyValuesFromXML(SDViewNode node,
                                                                                   SDDataEntity de,
                                                                                   boolean isMandatory)
                                                                            throws SDMappingException,
                                                                                   SDMetaDataException
Throws:
SDMappingException
SDMetaDataException

lookupEntity

public static boolean lookupEntity(SDViewNode destNode,
                                   java.util.Map<java.lang.String,java.lang.Object> altKey,
                                   SDDataEntity de)
                            throws SDMetaDataException,
                                   SDMappingException
Throws:
SDMetaDataException
SDMappingException

getAttributeValueFromVO

public static java.lang.String getAttributeValueFromVO(SDViewNode startNode,
                                                       oracle.jbo.ViewObject destinationVO,
                                                       java.lang.String attr,
                                                       oracle.jbo.Row r)
Find the given attribute value from the given VO by reverse traversing In case it is internal reference then it creates new VO's and uses them

Parameters:
startNode - source Node
destinationVO - partitioning vo
attr - attribute whose value is required
r - row
Returns:

validateDEData

public static boolean validateDEData(oracle.jbo.ViewObject vo)

getPartitionKeyValue

public static java.lang.String getPartitionKeyValue(SDReferenceUsage refUsage,
                                                    oracle.jbo.Row row)
For a given Reference Usage and the row of the source node, will find the partition key attribute value

Parameters:
refUsage -
row -
Returns:

constructViewCriteria

public static oracle.jbo.ViewCriteria constructViewCriteria(oracle.jbo.ViewObject vo,
                                                            oracle.jbo.ViewObject destVO,
                                                            oracle.jbo.Row row)
Constructs a view criteria using the key attributes from a given View object and values from the given row

Parameters:
vo - View criteria to be generated on
destVO - ViewObject from where the key's to be used in View Criteria
row - Row from where values are used
Returns:

areViewObjectsCompatible

public static boolean areViewObjectsCompatible(oracle.jbo.ViewObject srcVO,
                                               oracle.jbo.ViewObject destVO)
check if the primary keys of the view object match, if yes return true

Parameters:
srcVO - Viewobject
destVO - ViewObject
Returns:
true if vo's match

constructViewCriteria

public static oracle.jbo.ViewCriteria constructViewCriteria(oracle.jbo.ViewObject vo,
                                                            java.util.List<oracle.jbo.AttributeDef> attrs,
                                                            oracle.jbo.Row row,
                                                            SDMappedUsage mappedUsage)
creates the view criteria on the key attributes with values from the given row


Oracle Fusion Middleware extensions for Seed Data Framework
11g Release 1 (11.1.2)

E22564-02

Copyright © 2011 Oracle. All Rights Reserved.