Package org.synchronoss.cpo.core
Class BindableWhereBuilder<T>
java.lang.Object
org.synchronoss.cpo.core.BindableWhereBuilder<T>
- Type Parameters:
T- unused type parameter, retained for compatibility with existing callers
- All Implemented Interfaces:
NodeVisitor
A
NodeVisitor that walks a BindableCpoWhere tree and, as a side effect of the
traversal, accumulates both the rendered native (SQL/CQL) where-clause text and the ordered list
of BindAttribute values that must be bound to its parameter placeholders.- Author:
- david berry
-
Constructor Summary
ConstructorsConstructorDescriptionBindableWhereBuilder(CpoClass cpoClass) Creates a builder that resolves attributes against the given class while visiting a where tree. -
Method Summary
Modifier and TypeMethodDescriptionGets the bind values accumulated so far by visiting the tree, in the order their placeholders appear ingetWhereClause().Gets the native where-clause text accumulated so far by visiting the tree.booleanThis is called for component elements which have no childrenbooleanvisitBegin(Node node) This is called by composite nodes prior to visiting childrenbooleanThis is called by composite nodes after visiting childrenbooleanvisitMiddle(Node node) This is called for composite nodes between visiting children
-
Constructor Details
-
BindableWhereBuilder
Creates a builder that resolves attributes against the given class while visiting a where tree.- Parameters:
cpoClass- the class metadata used to resolve attributes to datastore columns
-
-
Method Details
-
getWhereClause
Gets the native where-clause text accumulated so far by visiting the tree.- Returns:
- the rendered where-clause text
-
getBindValues
Gets the bind values accumulated so far by visiting the tree, in the order their placeholders appear ingetWhereClause().- Returns:
- the ordered bind values
-
visitBegin
This is called by composite nodes prior to visiting children- Specified by:
visitBeginin interfaceNodeVisitor- Parameters:
node- The node to be visited- Returns:
- a boolean (false) to end visit or (true) to continue visiting
-
visitMiddle
This is called for composite nodes between visiting children- Specified by:
visitMiddlein interfaceNodeVisitor- Parameters:
node- The node to be visited- Returns:
- a boolean (false) to end visit or (true) to continue visiting
-
visitEnd
This is called by composite nodes after visiting children- Specified by:
visitEndin interfaceNodeVisitor- Parameters:
node- The node to be visited- Returns:
- a boolean (false) to end visit or (true) to continue visiting
-
visit
This is called for component elements which have no children- Specified by:
visitin interfaceNodeVisitor- Parameters:
node- The element to be visited- Returns:
- a boolean (false) to end visit or (true) to continue visiting
-