|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.force.sdk.jpa.query.ForceQueryUtils
public class ForceQueryUtils
This class contains the bulk of the logic for building SOQL queries based on the java query object.
Constructor Summary | |
---|---|
ForceQueryUtils(org.datanucleus.store.ExecutionContext ec,
ForceManagedConnection mconn,
org.datanucleus.store.query.AbstractJavaQuery query,
Map<Object,Object> parameters,
Map<String,QueryListener> listeners,
Map<String,Object> hints)
Create the query util for a specific query. |
Method Summary | |
---|---|
void |
appendRelationshipFields(ExpressionBuilderHelper helper,
ColumnImpl col,
String prefix)
Append the fields in the default fetch group for the entity in the relationship to the query. |
void |
appendRelationshipQuery(ExpressionBuilderHelper helper,
org.datanucleus.metadata.AbstractMemberMetaData ammd,
ColumnImpl col)
helper method to handle joining a relationship field to a query that is currently being built. |
String |
buildQuery(TableImpl table,
org.datanucleus.metadata.AbstractClassMetaData acmd,
Set<Integer> fieldsToLoad,
org.datanucleus.query.compiler.QueryCompilation compilation,
boolean skipId,
long maxLimit,
org.datanucleus.FetchPlan fetchPlan,
int fetchDepth,
String tableName,
boolean isTopLevel,
boolean isJoin,
String joinAlias,
ExpressionBuilderHelper parentHelper)
Build a query for fetching multiple objects, whether top level or part of a join query. |
String |
buildQuery(TableImpl table,
org.datanucleus.metadata.AbstractClassMetaData acmd,
Set<Integer> fieldsToLoad,
org.datanucleus.query.compiler.QueryCompilation compilation,
boolean skipId,
long maxLimit,
org.datanucleus.FetchPlan fetchPlan,
String tableName)
Build a query for fetching multiple top level objects. |
String |
buildQueryWithPK(TableImpl table,
org.datanucleus.metadata.AbstractClassMetaData acmd,
int[] fieldNumbers,
String pkValue,
int fetchDepth)
This is used for single item fetch by ID. |
static org.datanucleus.store.FieldValues2 |
getFieldValues2(org.datanucleus.metadata.AbstractClassMetaData acmd,
int[] fieldsToLoad,
ForceManagedConnection mconn,
ForceStoreManager storeManager,
com.sforce.ws.bind.XmlObject sobject,
org.datanucleus.store.query.Query query)
Constructs the proper interface for fetching fields on sobjects. |
static Object |
getIdFromObject(javax.jdo.spi.PersistenceCapable entity,
org.datanucleus.metadata.AbstractClassMetaData acmd)
convenience method for getting the id value from an entity. |
static com.force.sdk.jpa.query.ForceQueryUtils.LimitType |
getLimitType(org.datanucleus.store.query.Query query)
See if there is a limit set and if we can use SOQL to do our job. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ForceQueryUtils(org.datanucleus.store.ExecutionContext ec, ForceManagedConnection mconn, org.datanucleus.store.query.AbstractJavaQuery query, Map<Object,Object> parameters, Map<String,QueryListener> listeners, Map<String,Object> hints)
ec
- the ExecutionContextmconn
- the managed connection to connect to Force.comquery
- - parsed queryparameters
- - query parameterslisteners
- - query listenershints
- - query hintsMethod Detail |
---|
public static com.force.sdk.jpa.query.ForceQueryUtils.LimitType getLimitType(org.datanucleus.store.query.Query query)
query
- Query
public static org.datanucleus.store.FieldValues2 getFieldValues2(org.datanucleus.metadata.AbstractClassMetaData acmd, int[] fieldsToLoad, ForceManagedConnection mconn, ForceStoreManager storeManager, com.sforce.ws.bind.XmlObject sobject, org.datanucleus.store.query.Query query)
acmd
- the class metadata for the entity being queriedfieldsToLoad
- the fields selected by the query (or selected by the fetch group)mconn
- the managed connection to Force.com APIsstoreManager
- the store managersobject
- the sobject being queriedquery
- the query for retrieving objects
public String buildQueryWithPK(TableImpl table, org.datanucleus.metadata.AbstractClassMetaData acmd, int[] fieldNumbers, String pkValue, int fetchDepth)
table
- the table for the entity being queriedacmd
- the class metadata for the entity being queriedfieldNumbers
- the fields to fetchpkValue
- the id of the object being fetchedfetchDepth
- the maximum depth that can be traversed
by a query involving relationships
public String buildQuery(TableImpl table, org.datanucleus.metadata.AbstractClassMetaData acmd, Set<Integer> fieldsToLoad, org.datanucleus.query.compiler.QueryCompilation compilation, boolean skipId, long maxLimit, org.datanucleus.FetchPlan fetchPlan, String tableName)
table
- the table representing the object being queriedacmd
- the class metadata for the object being queriedfieldsToLoad
- the set of fields to loadcompilation
- the compile queryskipId
- true if the id field should be skipped which might be necessary during joinsmaxLimit
- the max number of entities that can be retrieved by this queryfetchPlan
- the fetch plan used for this querytableName
- the name of the entity in Force.com
public String buildQuery(TableImpl table, org.datanucleus.metadata.AbstractClassMetaData acmd, Set<Integer> fieldsToLoad, org.datanucleus.query.compiler.QueryCompilation compilation, boolean skipId, long maxLimit, org.datanucleus.FetchPlan fetchPlan, int fetchDepth, String tableName, boolean isTopLevel, boolean isJoin, String joinAlias, ExpressionBuilderHelper parentHelper)
table
- the table representing the object being queriedacmd
- the class metadata for the object being queriedfieldsToLoad
- the set of fields to loadcompilation
- the compile queryskipId
- true if the id field should be skipped which might be necessary during joinsmaxLimit
- the max number of entities that can be retrieved by this queryfetchPlan
- the fetch plan used for this queryfetchDepth
- the depth that fetches should go (i.e. how many relationships can be traversed)tableName
- the name of the entity in Force.comisTopLevel
- whether this object is the top level entity being queried or is part of a subqueryisJoin
- whether this is part of a join calljoinAlias
- the alias for a join queryparentHelper
- the expression builder for the parent query
public static Object getIdFromObject(javax.jdo.spi.PersistenceCapable entity, org.datanucleus.metadata.AbstractClassMetaData acmd)
entity
- the entity containing the idacmd
- the class metadata (for discovering the id field)
public void appendRelationshipQuery(ExpressionBuilderHelper helper, org.datanucleus.metadata.AbstractMemberMetaData ammd, ColumnImpl col)
helper
- the expression builder with the in progress queryammd
- the member metadata for the relationship being appendedcol
- the column data for the relationship fieldpublic void appendRelationshipFields(ExpressionBuilderHelper helper, ColumnImpl col, String prefix)
helper
- the expression builder with the in progress querycol
- the column data for the relationship fieldprefix
- the prefix to add to the relationship field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |