com.irisel.oms.olapi
Class QueryTree

java.lang.Object
  extended by com.irisel.oms.olapi.QueryTree

public class QueryTree
extends java.lang.Object

This class is used to make relational queries in 3-tier mode, using a CLBrowser. Based upon deprecated InstanceRetrieval, which was 2-tier.

Author:
jmgomez

Constructor Summary
QueryTree()
           
QueryTree(CLBrowser clb)
           
 
Method Summary
 void addBranch(int branchIndex, int parentBranchIndex, java.lang.String relationName)
          This method is intended to get related records using ad-hoc or db-level defined relationships.
 void addBranch(int branchIndex, int parentBranchIndex, java.lang.String relationName, boolean forward)
           
 void addBranch(int branchIndex, int parentBranchIndex, java.lang.String relationName, java.lang.String roleSrcName, java.lang.String roleDstName, boolean forward)
          This method adds a branch to the QueryTree.
 void addBranch(int branchIndex, java.lang.String classname)
           
 void addFilter(int branchIndex, Filter filt)
           
 void addFilter(int branchIndex, Filter[] filt)
           
 void addFilter(int branchIndex, Filter[][] filt)
           
 void addFilter(int branchIndex, java.lang.String propertyName, int operator, java.lang.Object value)
           
 void addFilterAlternatives(int branchIndex, Filter[] filt)
          These filters are OR-ed
 void addLimit(int id, int rowcount)
           
 void addSort(int id, java.lang.String propertyName, int operator)
           
 com.irisel.oms.olapi.QTBranch getBranch(int id)
           
 java.util.Vector getBranches()
          Access method for the branches property.
 CLBrowser getBrowser()
          Getter for property browser.
 InstanceSet getInstanceIds(int id)
           
 InstanceSet getInstanceSet(int id)
           
 void prepareStatements()
           
 void setBranches(java.util.Vector aBranches)
          Sets the value of the branches property.
 void setBrowser(CLBrowser browser)
          Setter for property browser.
 void setRoot(int branchIndex, Instance record)
           
 void setRoot(int branchIndex, java.lang.String classname)
           
 void setRoot(java.lang.String classname)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryTree

public QueryTree(CLBrowser clb)
          throws QueryTreeException
Throws:
QueryTreeException

QueryTree

public QueryTree()
          throws QueryTreeException
Throws:
QueryTreeException
Method Detail

getBranches

public java.util.Vector getBranches()
Access method for the branches property.

Returns:
the current value of the branches property

getBranch

public com.irisel.oms.olapi.QTBranch getBranch(int id)

setBranches

public void setBranches(java.util.Vector aBranches)
Sets the value of the branches property.

Parameters:
aBranches - the new value of the branches property

setRoot

public void setRoot(java.lang.String classname)
             throws QueryTreeException
Parameters:
classname -
Throws:
QueryTreeException

setRoot

public void setRoot(int branchIndex,
                    java.lang.String classname)
             throws QueryTreeException
Throws:
QueryTreeException

setRoot

public void setRoot(int branchIndex,
                    Instance record)
             throws QueryTreeException
Throws:
QueryTreeException

addFilter

public void addFilter(int branchIndex,
                      java.lang.String propertyName,
                      int operator,
                      java.lang.Object value)
Parameters:
branchIndex -
propertyName -
operator -
value -

addFilter

public void addFilter(int branchIndex,
                      Filter filt)

addFilter

public void addFilter(int branchIndex,
                      Filter[] filt)

addFilter

public void addFilter(int branchIndex,
                      Filter[][] filt)

addFilterAlternatives

public void addFilterAlternatives(int branchIndex,
                                  Filter[] filt)
These filters are OR-ed

Parameters:
branchIndex -
filt -

addBranch

public void addBranch(int branchIndex,
                      java.lang.String classname)
               throws QueryTreeException
Throws:
QueryTreeException

addBranch

public void addBranch(int branchIndex,
                      int parentBranchIndex,
                      java.lang.String relationName)
               throws QueryTreeException
This method is intended to get related records using ad-hoc or db-level defined relationships. The name of the relation MUST follow the pattern: table1.field1-->table2.field2

Parameters:
branchIndex -
parentBranchIndex -
relationName -
Throws:
QueryTreeException

addBranch

public void addBranch(int branchIndex,
                      int parentBranchIndex,
                      java.lang.String relationName,
                      boolean forward)
               throws QueryTreeException
Throws:
QueryTreeException

addBranch

public void addBranch(int branchIndex,
                      int parentBranchIndex,
                      java.lang.String relationName,
                      java.lang.String roleSrcName,
                      java.lang.String roleDstName,
                      boolean forward)
               throws QueryTreeException
This method adds a branch to the QueryTree.

Parameters:
branchIndex - : The unique index that identifies this branch
parentBranchIndex - : The parent branch to which this branch is related
relationName - : name of the relation that links this branch to parent
roleSrcName - : role of this branch objects played in the relation
roleDstName - : role that parent objects play in the relation
forward - : direction of the relation ( Relation.FORWARD or Relation.REVERSE
Throws:
QueryTreeException

addSort

public void addSort(int id,
                    java.lang.String propertyName,
                    int operator)

addLimit

public void addLimit(int id,
                     int rowcount)

prepareStatements

public void prepareStatements()
                       throws QueryTreeException
Throws:
QueryTreeException

getInstanceSet

public InstanceSet getInstanceSet(int id)
                           throws QueryTreeException
Parameters:
id -
Returns:
com.irisel.oms.olapi.InstanceSet
Throws:
QueryTreeException

getInstanceIds

public InstanceSet getInstanceIds(int id)
                           throws QueryTreeException
Throws:
QueryTreeException

getBrowser

public CLBrowser getBrowser()
Getter for property browser.

Returns:
Value of property browser.

setBrowser

public void setBrowser(CLBrowser browser)
Setter for property browser.

Parameters:
browser - New value of property browser.