|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.brb.query.QueryNode
This abstract class represents a node for a query. A node can
be a comparison, such as name = 'isEligible'
or a logical
operation, such as an and
clause.
QueryNodes are given to method
findRules
on class
IRuleFolder
. This will search for rules in
the IRuleFolder
(and optionally in subfolders) that match the query
specified in the given QueryNode
.
The best way to understand how this query framework works is to look at a few
examples. In the following example, RuleNameNode
is a class that extends from
QueryNode
. To find all rules named "isEligible", do the following:
// Initial setup to get the root rule folder IRuleFolder root = RuleMgmtHelper.getRootFolder(); // Find rules named "isEligible" in the root folder and in subfolders RuleNameNode nameNode = new RuleNameNode("isEligible", RuleNameNode.EQUAL); Collection coll = root.findRules(nameNode, true, IRule.TYPE_COPY);To find all rules named "isEligible" with classification of "SeniorCitizen", do the following:
IRuleFolder root = RuleMgmtHelper.getRootFolder(); RuleNameNode nameNode = new RuleNameNode("isEligible", RuleNameNode.EQUAL); ClassificationNode cNode = new ClassificationNode("SeniorCitizen", ClassificationNode.EQUAL); AndNode andNode = new AndNode(nameNode, cNode); Collection coll = root.findRules(andNode, true, IRule.TYPE_COPY);Comparison nodes (
AndNode
and OrNode
) allow you to pass many nodes
to be combined together. The following forms a query that combines four nodes into
the AndNode:
IRuleFolder root = RuleMgmtHelper.getRootFolder();probal RuleNameNode nameNode = new RuleNameNode("isEligible", RuleNameNode.EQUAL); ClassificationNode cNode = new ClassificationNode("Senior%", ClassificationNode.LIKE); // In effect in the year 2000 StartDateNode sdNode = new StartDateNode(new Date(2000, 01, 01), StartDateNode.AFTER_INCLUSIVE); EndDateNode edNode = new EndDateNode(new Date(2001, 01, 01), StartDateNode.BEFORE_EXCLUSIVE); AndNode andNode = new AndNode(new QueryNode[] { nameNode, cNode, sdNode, edNode} ); Collection coll = root.findRules(andNode, true, IRule.TYPE_COPY);
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
Deprecated. |
Constructor Summary | |
---|---|
QueryNode()
Deprecated. |
Method Summary | |
---|---|
java.lang.String |
getWhereClause(java.util.Vector boundAttributes)
Deprecated. FOR IBM INTERNAL USE ONLY. |
java.lang.String |
toString()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String COPYRIGHT
Constructor Detail |
public QueryNode()
Method Detail |
public java.lang.String getWhereClause(java.util.Vector boundAttributes) throws BusinessRuleBeansException
BusinessRuleBeansException
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |