com.sun.mdm.index.query
Class QueryHelper

java.lang.Object
  extended bycom.sun.mdm.index.query.QueryHelper

public class QueryHelper
extends java.lang.Object

Performs basic straight JDBC calls for statically defined tables


Constructor Summary
QueryHelper()
          Creates a new instance of QueryHelper
 
Method Summary
 java.lang.String[] findAllMergedLIDs(java.sql.Connection conn, java.lang.String lid)
          Deep searches merged LIDs to find the complete graph
 java.lang.String getEUID(java.sql.Connection con, SystemObjectPK key)
          Given a system object key, lookup its EUID.
 java.lang.String getEUID(java.sql.Connection con, SystemObjectPK key, java.lang.String status)
          Given a system object key, lookup its EUID.
 java.lang.Integer getRevisionNumber(java.sql.Connection con, java.lang.String euid)
          Retrieves the SBR revision number for an EUID
 java.lang.String getSOStatus(java.sql.Connection con, SystemObjectPK key)
          Given a system object key, return its status.
 java.lang.String[] lookupSystemCodes(java.sql.Connection con)
          return System codes
 SystemDefinition lookupSystemDefinition(java.sql.Connection con, java.lang.String systemCode)
          Return system definition for a specific system code
 SystemDefinition[] lookupSystemDefinitions(java.sql.Connection con)
          return System codes
 SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con, java.lang.String euid)
          Retrieve active SystemObject keys.
 SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con, java.lang.String euid, java.lang.String status)
          return SystemObjectKeys
 SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con, java.lang.String sourceSystem, java.lang.String sourceLID, java.lang.String destSystem, java.lang.String status)
          Performs cross lookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryHelper

public QueryHelper()
Creates a new instance of QueryHelper

Method Detail

findAllMergedLIDs

public java.lang.String[] findAllMergedLIDs(java.sql.Connection conn,
                                            java.lang.String lid)
                                     throws QMException
Deep searches merged LIDs to find the complete graph

Parameters:
conn - jdbc connection
Throws:
QMException

getEUID

public java.lang.String getEUID(java.sql.Connection con,
                                SystemObjectPK key)
                         throws QMException
Given a system object key, lookup its EUID. If EUID not found, return null.

Parameters:
con - Connection
key - SystemObjectPK
Returns:
EUID
Throws:
QMException - QMException

getEUID

public java.lang.String getEUID(java.sql.Connection con,
                                SystemObjectPK key,
                                java.lang.String status)
                         throws QMException
Given a system object key, lookup its EUID. If EUID not found, return null.

Parameters:
con - Connection
key - SystemObjectPK
status - status
Returns:
EUID
Throws:
QMException - QMException

getRevisionNumber

public java.lang.Integer getRevisionNumber(java.sql.Connection con,
                                           java.lang.String euid)
                                    throws QMException
Retrieves the SBR revision number for an EUID

Parameters:
euid - EUID to check
Returns:
SBR revision number for the EUID
Throws:
QMException - if more than one revision number is found.

getSOStatus

public java.lang.String getSOStatus(java.sql.Connection con,
                                    SystemObjectPK key)
                             throws QMException
Given a system object key, return its status. If status is not found, return null.

Parameters:
con - Connection
key - SystemObjectPK
Returns:
status
Throws:
QMException - QMException

lookupSystemCodes

public java.lang.String[] lookupSystemCodes(java.sql.Connection con)
                                     throws QMException
return System codes

Parameters:
con - Connection
Returns:
String[] array of systemcodes
Throws:
QMException - QMException

lookupSystemDefinition

public SystemDefinition lookupSystemDefinition(java.sql.Connection con,
                                               java.lang.String systemCode)
                                        throws QMException
Return system definition for a specific system code

Parameters:
con - Connection
systemCode - System Code to look up
Returns:
SystemDefinition System definition
Throws:
QMException - QMException

lookupSystemDefinitions

public SystemDefinition[] lookupSystemDefinitions(java.sql.Connection con)
                                           throws QMException
return System codes

Parameters:
con - Connection
Returns:
String[] array of systemcodes
Throws:
QMException - QMException

lookupSystemObjectKeys

public SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con,
                                               java.lang.String euid)
                                        throws QMException
Retrieve active SystemObject keys. If no keys found, return null.

Parameters:
euid - EUID
con - Connection
Returns:
SystemObjectPK[]
Throws:
QMException - QMException

lookupSystemObjectKeys

public SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con,
                                               java.lang.String euid,
                                               java.lang.String status)
                                        throws QMException
return SystemObjectKeys

Parameters:
euid - EUID
status - status
con - Connection
Returns:
SystemObjectPK[]
Throws:
QMException - QMException

lookupSystemObjectKeys

public SystemObjectPK[] lookupSystemObjectKeys(java.sql.Connection con,
                                               java.lang.String sourceSystem,
                                               java.lang.String sourceLID,
                                               java.lang.String destSystem,
                                               java.lang.String status)
                                        throws QMException
Performs cross lookup

Parameters:
sourceSystem - the source system
sourceLID - the source local id
destSystem - the destination system
status - status of records in destination system to search for
con - Connection
Returns:
array of system keys for given system or null if none found
Throws:
QMException - QMException


Sun Microsystems, Inc.