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

public class BindableWhereBuilder<T> extends Object implements 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 Details

    • BindableWhereBuilder

      public BindableWhereBuilder(CpoClass cpoClass)
      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

      public String getWhereClause()
      Gets the native where-clause text accumulated so far by visiting the tree.
      Returns:
      the rendered where-clause text
    • getBindValues

      public Collection<BindAttribute> getBindValues()
      Gets the bind values accumulated so far by visiting the tree, in the order their placeholders appear in getWhereClause().
      Returns:
      the ordered bind values
    • visitBegin

      public boolean visitBegin(Node node)
      This is called by composite nodes prior to visiting children
      Specified by:
      visitBegin in interface NodeVisitor
      Parameters:
      node - The node to be visited
      Returns:
      a boolean (false) to end visit or (true) to continue visiting
    • visitMiddle

      public boolean visitMiddle(Node node)
      This is called for composite nodes between visiting children
      Specified by:
      visitMiddle in interface NodeVisitor
      Parameters:
      node - The node to be visited
      Returns:
      a boolean (false) to end visit or (true) to continue visiting
    • visitEnd

      public boolean visitEnd(Node node)
      This is called by composite nodes after visiting children
      Specified by:
      visitEnd in interface NodeVisitor
      Parameters:
      node - The node to be visited
      Returns:
      a boolean (false) to end visit or (true) to continue visiting
    • visit

      public boolean visit(Node node)
      This is called for component elements which have no children
      Specified by:
      visit in interface NodeVisitor
      Parameters:
      node - The element to be visited
      Returns:
      a boolean (false) to end visit or (true) to continue visiting