com.sun.mdm.index.query
Class SingleQPath

java.lang.Object
  extended bycom.sun.mdm.index.query.QPath
      extended bycom.sun.mdm.index.query.SingleQPath

class SingleQPath
extends QPath

This is used for Single Query option. Say if object graph is: System Person Address Phone, SingleQPath would contain all the nodes: { System, Person, Address, Phone } The reason it subclass QPath is that QPath creates subpaths for objects those are not in QPath. In case of SingleQPath, the subpaths would be those objects which have conditions but are not included in the QPath. Note: Because SingleQPath contains all the objects in the select tree, the SQL statement created by it would produce lots of redundant data. So this is more useful where the applications want tuples.


Constructor Summary
(package private) SingleQPath()
          Creates a new instance of SingleQPath
 
Method Summary
(package private)  void add(JoinList joinList)
           
(package private)  void add(java.lang.String object)
           
(package private)  QPath cloneLessLeaf()
           
(package private)  boolean contains(java.lang.String object)
           
(package private)  java.lang.StringBuffer createANSIJoin(java.lang.StringBuffer innerBuf, java.lang.String primaryObject, java.lang.String secondaryObject, boolean outerJoin, boolean nesting)
           
(package private)  java.lang.StringBuffer createANSIJoins()
          creates Joins that conform to SQL 99 ANSI syntax
(package private)  java.lang.StringBuffer createConditions(ConditionMap conditionMap, int unionIndex)
           
(package private)  java.lang.StringBuffer createFromTable(int unionIndex)
           
(package private)  void createJoin(java.lang.StringBuffer joinFields, java.lang.String primaryObject, java.lang.String secondaryObject)
           
(package private)  java.lang.StringBuffer createJoins(int unionIndex)
           
(package private)  java.lang.StringBuffer createOrderBy()
           
(package private)  java.lang.StringBuffer createOrderBy(SQLDescriptor sqlDesc)
           
(package private)  void createOuterJoin(java.lang.StringBuffer joinFields, java.lang.String primaryObject, java.lang.String secondaryObject)
           
(package private)  java.lang.StringBuffer createSelectFields(SQLDescriptor sqlDesc, QualifiedField[] selectFields)
           
(package private)  java.lang.StringBuffer createSelectFields(SQLDescriptor sqlDesc, SelectMap selectMap)
          The subclass would implement this method.
(package private)  SQLDescWithBindParameters createSQL(ConditionMap[] conditionMaps, java.lang.Object selectObject, int maxRows, java.lang.String[] hints)
           
(package private)  java.lang.StringBuffer createSQL(java.lang.StringBuffer selectbuf, java.lang.StringBuffer fromTable, java.lang.StringBuffer joinbuf, java.lang.StringBuffer conditionbuf, int maxRows, java.lang.String hint)
           
(package private)  void createsubQPath(QPath[] conditionPaths, ConditionMap[] conditionMaps)
          This methods creates list of subpaths for each QPath.
(package private)  Condition[] getConditions()
           
(package private)  java.util.List getFieldPrepareIndex()
           
(package private)  int getIndex(java.lang.String object)
           
(package private)  java.lang.String getLeaf()
           
(package private)  java.lang.String getObject(int i)
           
(package private)  java.lang.String getRoot()
           
(package private)  void initPrepareIndexMap(int size)
           
(package private)  void setConditions(Condition[] conditions)
           
(package private)  int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleQPath

SingleQPath()
Creates a new instance of SingleQPath

Method Detail

add

void add(JoinList joinList)

add

void add(java.lang.String object)

cloneLessLeaf

QPath cloneLessLeaf()

contains

boolean contains(java.lang.String object)

createANSIJoin

java.lang.StringBuffer createANSIJoin(java.lang.StringBuffer innerBuf,
                                      java.lang.String primaryObject,
                                      java.lang.String secondaryObject,
                                      boolean outerJoin,
                                      boolean nesting)
Parameters:
innerBuf - if null, use secondary object table within the constructed clause otherwise use innerBuf in the constructed ANSI join as in example below. If nesting is false, innerBuf should be false too.
primaryObject -
secondaryObject -
outerJoin -
nesting - false: ansi clause is of to constructed in form: ex: sbyn_person left outer join sbyn_address on sbyn_person.personid=sbyn_address.personid left outer join sbyn_alias on sbyn_person.personid = sbyn_alias.personid nesting true: ansi clause is of form: ex: (sbyn_systemobject left outer join (sbyn_person left outer join sbyn_address on sbyn_person.personid=sbyn_address.personid) on sbyn_systemobject.systemcode = sbyn_person.systemcode and sbyn_systemobject.lid = sbyn_person.lid )
Returns:

createANSIJoins

java.lang.StringBuffer createANSIJoins()
creates Joins that conform to SQL 99 ANSI syntax

Overrides:
createANSIJoins in class QPath

createConditions

java.lang.StringBuffer createConditions(ConditionMap conditionMap,
                                        int unionIndex)

createFromTable

java.lang.StringBuffer createFromTable(int unionIndex)

createJoin

void createJoin(java.lang.StringBuffer joinFields,
                java.lang.String primaryObject,
                java.lang.String secondaryObject)

createJoins

java.lang.StringBuffer createJoins(int unionIndex)
Overrides:
createJoins in class QPath

createOrderBy

java.lang.StringBuffer createOrderBy()

createOrderBy

java.lang.StringBuffer createOrderBy(SQLDescriptor sqlDesc)

createOuterJoin

void createOuterJoin(java.lang.StringBuffer joinFields,
                     java.lang.String primaryObject,
                     java.lang.String secondaryObject)

createSelectFields

java.lang.StringBuffer createSelectFields(SQLDescriptor sqlDesc,
                                          QualifiedField[] selectFields)

createSelectFields

java.lang.StringBuffer createSelectFields(SQLDescriptor sqlDesc,
                                          SelectMap selectMap)
The subclass would implement this method.

Parameters:
sqlDesc -
selectMap -

createSQL

SQLDescWithBindParameters createSQL(ConditionMap[] conditionMaps,
                                    java.lang.Object selectObject,
                                    int maxRows,
                                    java.lang.String[] hints)
Description copied from class: QPath
create SQLDescriptor. The selectMap gives all the fields to be selected in the SQL statement. conditionMap gives all the conditions that needs to be set in this SQL statement. Note: This implemenation is done from MultiQPath (multiple queries) point of view. subclass SinglePath needs to override this method.

Overrides:
createSQL in class QPath
Parameters:
conditionMaps -
selectObject -

createSQL

java.lang.StringBuffer createSQL(java.lang.StringBuffer selectbuf,
                                 java.lang.StringBuffer fromTable,
                                 java.lang.StringBuffer joinbuf,
                                 java.lang.StringBuffer conditionbuf,
                                 int maxRows,
                                 java.lang.String hint)

createsubQPath

void createsubQPath(QPath[] conditionPaths,
                    ConditionMap[] conditionMaps)
This methods creates list of subpaths for each QPath. Given a QPath a subpath is formed from other QPaths. A subpath is navigation from the lowest leaf in a QPath that has a condition, to the intersecting node in QPath. So if this QPath is { System Person Address } and other QPaths are { System Person Phone }, { System Person Alias } and conditions are Phone.area = '626' and System.EUID = 'E1', then subpaths would be: {Person Phone}. Alias path is not included because it does not have condition. System is not included in subpath because it is already in the QPath. If there are more than one CondtionMap, then each QPath contains list of subpaths list. So each list of subpaths list is used in Union operation. Note: Each ConditionMap in ConditionMap[] is for a different union operation of conditions.

Parameters:
conditionPaths -
conditionMaps -

getConditions

Condition[] getConditions()

getFieldPrepareIndex

java.util.List getFieldPrepareIndex()

getIndex

int getIndex(java.lang.String object)

getLeaf

java.lang.String getLeaf()

getObject

java.lang.String getObject(int i)

getRoot

java.lang.String getRoot()

initPrepareIndexMap

void initPrepareIndexMap(int size)

setConditions

void setConditions(Condition[] conditions)

size

int size()

toString

public java.lang.String toString()
Description copied from class: QPath
String representation of QPath

Overrides:
toString in class QPath


Sun Microsystems, Inc.