com.force.sdk.jpa.query
Class ExpressionBuilderHelper

java.lang.Object
  extended by com.force.sdk.jpa.query.ExpressionBuilderHelper

public class ExpressionBuilderHelper
extends Object

Helper class for building the WHERE clause in SOQL queries.

Author:
Fiaz Hossain

Method Summary
 void appendRelationship(org.datanucleus.metadata.AbstractClassMetaData colCmd, int fieldNum, ColumnImpl col, String prefix, boolean isQuery)
          Appends a relationship via a join to this query builder.
 StringBuilder getBuilder()
           
 org.datanucleus.query.expression.Expression getFilterExpression(String alias)
          First looks in filter mappings cache for the filter expression associated with the given alias, else returns the expression from the compilation.
 boolean isJoinQuery()
          check for whether the query is joined.
 boolean skipRelationship()
          this method tells us whether to skip querying for relationship fields by comparing the current depth of the query to the maximum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendRelationship

public void appendRelationship(org.datanucleus.metadata.AbstractClassMetaData colCmd,
                               int fieldNum,
                               ColumnImpl col,
                               String prefix,
                               boolean isQuery)
Appends a relationship via a join to this query builder.

Parameters:
colCmd - the class metadata of the relationship column
fieldNum - the field number of the relationship column
col - the column object for the relationship field
prefix - the prefix to use for the join
isQuery - true if we're appending the relationship field but not all of the fields of the related object

getBuilder

public StringBuilder getBuilder()

isJoinQuery

public boolean isJoinQuery()
check for whether the query is joined.

Returns:
true if this query is being joined

getFilterExpression

public org.datanucleus.query.expression.Expression getFilterExpression(String alias)
First looks in filter mappings cache for the filter expression associated with the given alias, else returns the expression from the compilation.

Parameters:
alias - the alias of the queried object
Returns:
the filter expression of a query

skipRelationship

public boolean skipRelationship()
this method tells us whether to skip querying for relationship fields by comparing the current depth of the query to the maximum.

Returns:
true if the current depth of the query is greater or equal to the maximum depth we can fetch


Copyright © 2011. All Rights Reserved.