Top Description Fields Constructors Methods
org.eclipse.persistence.internal.queries

public Class JoinedAttributeManager

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.Serializable, java.util.ArrayList, .HashMap, .Iterator, .List, .Map, .Set, .Vector, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.QueryException, org.eclipse.persistence.expressions.Expression, .ExpressionBuilder, org.eclipse.persistence.internal.descriptors.ObjectBuilder, org.eclipse.persistence.internal.expressions.BaseExpression, .ForUpdateOfClause, .ObjectExpression, .QueryKeyExpression, org.eclipse.persistence.internal.helper.DatabaseField, .NonSynchronizedSubVector, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.mappings.DatabaseMapping, .ForeignReferenceMapping, org.eclipse.persistence.queries.Cursor, .FetchGroup, .ObjectBuildingQuery, .ObjectLevelReadQuery, org.eclipse.persistence.sessions.DatabaseRecord

Purpose: A common class to be used by ObjectLevelReadQueries and ReportItems. This Class will be used to store Joined Attribute Expressions. It will also store the indexes for object construction.

Author
Gordon Yorke
Since
EJB3.0 RI

Field Summary

Modifier and TypeField and Description
protected transient List<Expression>
protected ExpressionBuilder
baseExpressionBuilder

Stores the base builder for resolving joined attributes by name.

protected ObjectBuildingQuery
baseQuery

Stores the base query.

protected transient List<AbstractRecord>
dataResults

Stored all row results to -m joining.

protected transient Map<Object, List<AbstractRecord>>
dataResultsByPrimaryKey

Stored all row results to -m joining by cache key.

protected transient ClassDescriptor
descriptor

Stores the descriptor that these joins apply on

protected boolean
hasOuterJoinedAttribute

PERF: Used to avoid null checks for inner attribute joining.

protected boolean
isToManyJoin

Used to determine if -m joining has been used.

protected transient List<DatabaseMapping>
joinedAggregateMappings

Stores AggregateObjectMapping expressions used within local join expressions

protected List<Expression>
joinedAttributeExpressions

Stores the joined attributes added through the query

protected transient List<DatabaseMapping>
joinedAttributeMappings

indexed list of mappings corresponding to

protected List<Expression>
joinedAttributes

PERF: Cache the local joined attribute expressions.

protected List<Expression>
joinedMappingExpressions

Stores the joined attributes as specified in the descriptor

protected transient Map<DatabaseMapping, Object>
joinedMappingIndexes

Used internally for joining.

protected transient Map<DatabaseMapping, ObjectLevelReadQuery>
joinedMappingQueries

Used internally for joining.

protected transient Map<DatabaseMapping, ObjectLevelReadQuery>
joinedMappingQueryClones

PERF: Stores the cloned joinedMappingQueries.

protected Expression
lastJoinedAttributeBaseExpression

Stores the last used base expression while adding joined attribute expression.

protected transient List<Expression>
protected int
parentResultIndex

Stores the result index of the parent, used for oneToMany joins.

protected boolean
shouldFilterDuplicates

Determine if duplicate rows should be filter when using 1-m joining.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Expression
addAndPrepareJoinedMapping(ForeignReferenceMapping mapping, AbstractSession session)

Add the mapping for join fetch, prepare and return the join expression being used.

protected Expression
addExpressionAndBaseToGroupedList(Expression expression, List<E> expressionlist, Expression lastJoinedAttributeBaseExpression)

adds expression and its base expressions recursively to the expressionList in groups, so that an expression is never listed before its base expression

public void
addJoinedAttribute(Expression attributeExpression)

public void
public void
addJoinedMapping(String attributeName)

Add an attribute represented by the given attribute name to the list of joins for this query.

public void
addJoinedMappingExpression(Expression mappingExpression)

Add an attribute represented by the given attribute name to the list of joins for this query.

public void
clear()

Clear the joining state.

public void
clearDataResults()

Clear the data-results for joined data for a 1-m join.

public JoinedAttributeManager
clone()

Overrides java.lang.Object.clone.

Clones the Joined Attribute Manager.
protected int

Returns:

Current joined mapping index updated.
computeIndexesForJoinedExpressions
(final List<E>
Join expressions List.
joinedExpressions
,
int
Current joined mapping index.
currentIndex
,
final AbstractSession
Current session.
session
)

This method is used when computing the indexes for joined mappings.

public int
computeJoiningMappingIndexes(boolean includeAllSubclassFields, AbstractSession session, int offset)

For joining the resulting rows include the field/values for many objects.

public void
computeJoiningMappingQueries(AbstractSession session)

Used to optimize joining by pre-computing the nested join queries for the mappings.

protected void
computeNestedQueriesForJoinedExpressions(List<E> joinedExpressions, AbstractSession session, ObjectLevelReadQuery readQuery)

This method is used when computing the nested queries for joined mappings.

public void
copyFrom(JoinedAttributeManager otherJoinManager)

Copies settings from another manager.

public List<Expression>
getAdditionalFieldExpressions()

Get the list of additional field expressions.

public List<Expression>
getAdditionalFieldExpressions_()

Get the list of additional field expressions.

public ExpressionBuilder
getBaseExpressionBuilder()

Returns the base expression builder for this query.

public ObjectBuildingQuery
getBaseQuery()

Returns the base query.

public List<AbstractRecord>
getDataResults_()

Return all of the rows fetched by the query, used for 1-m joining.

public Map<Object, List<AbstractRecord>>
getDataResultsByPrimaryKey()

Return all of the rows fetched by the query by cache-key, used for 1-m joining.

public ClassDescriptor
public List<DatabaseMapping>
getJoinedAggregateMappings()

Return the attributes that must be joined.

public List<Expression>
getJoinedAttributeExpressions()

Return the attributes that must be joined.

public List<DatabaseMapping>
getJoinedAttributeMappings()

Return the attributes that must be joined.

public List<Expression>
getJoinedAttributes()

Return the attributes that must be joined.

public List<Expression>
getJoinedMappingExpressions()

Get the list of expressions that represent elements that are joined because of their mapping for this query.

public Map<DatabaseMapping, Object>
getJoinedMappingIndexes_()

Return the joined mapping indexes, used to compute mapping row partitions.

public Map<DatabaseMapping, ObjectLevelReadQuery>
getJoinedMappingQueries_()

Return the joined mapping queries, used optimize joining, only compute the nested queries once.

public Map<DatabaseMapping, ObjectLevelReadQuery>
public ObjectLevelReadQuery
getNestedJoinedMappingQuery(Expression expression)

INTERNAL: Returns the nested query corresponding to the expression.

public List<Expression>
getOrderByExpressions()

Get the list of orderBy expressions.

public List<Expression>
getOrderByExpressions_()

Get the list of orderBy expressions.

public int
public Object
getValueFromObjectForExpression(AbstractSession session, Object clone, ObjectExpression expression)

INTERNAL: Helper method to get the value from the clone for the expression passed in, triggering joins on all intermediate steps.

public boolean
hasAdditionalFieldExpressions()

Return if there are additional field expressions.

public boolean
hasJoinedAttributeExpressions()

Return the attributes that must be joined.

public boolean
hasJoinedAttributes()

Return if any attributes are joined.

public boolean
hasJoinedExpressions()

This method checks both attribute expressions and mapping expressions and determines if there are any joins to be made.

public boolean
hasJoinedMappingExpressions()

Return the attributes that must be joined.

public boolean
hasOrderByExpressions()

Return if there are orderBy expressions.

public boolean
hasOuterJoinedAttributeQuery()

PERF: Return if the query uses any outer attribute joins, used to avoid null checks in building objects.

protected boolean
isAttributeExpressionJoined(DatabaseMapping attributeMapping)

Return if the attribute is specified for joining.

public boolean
isAttributeJoined(ClassDescriptor mappingDescriptor, DatabaseMapping attributeMapping)

Return if the attribute is specified for joining.

protected boolean
isAttributeMappingJoined(DatabaseMapping attributeMapping)

Return whether the given attribute is joined as a result of a join on a mapping

protected boolean
isAttributeNameInJoinedExpressionList(String attributeName, List<E> joinedExpressionList)

Iterate through a list of expressions searching for the given attribute name.

protected boolean
isMappingInJoinedExpressionList(DatabaseMapping attributeMapping, List<E> joinedExpressionList)

Iterate through a list of expressions searching for the given attribute name.

public boolean
isToManyJoin()

Return if the query uses any -m joins, and thus return duplicate/multiple rows.

protected Expression
prepareJoinExpression(Expression expression, AbstractSession session)

Validate and prepare the join expression.

public void
prepareJoinExpressions(AbstractSession session)

Validate and prepare join expressions.

protected void
processDataResults(AbstractSession session)

Process the data-results for joined data for a 1-m join.

public AbstractRecord
processDataResults(AbstractRecord row, Cursor cursor, boolean forward)

Process the data-results for joined data for a 1-m join.

public void
processJoinedMappings(AbstractSession session)

This method collects the Joined Mappings from the descriptor and initializes them.

public void
reset()

Reset the JoinedAttributeManager.

public void
setAdditionalFieldExpressions_(List<Expression> expressions)

Set the list of additional field expressions.

protected void
setBaseExpressionBuilder(ExpressionBuilder builder)

This method is called from within this package, it is used when initializing a ReportItem

public void
setBaseQuery(ObjectLevelReadQuery query)

This method is called from within this package it is used when initializing a report Item

public void
setDataResults(List<E> dataResults, AbstractSession session)

Set all of the rows fetched by the query, used for 1-m joining.

protected void
setDataResultsByPrimaryKey(Map<Object, List<AbstractRecord>> dataResultsByPrimaryKey)

Set all of the rows fetched by the query by cache-key, used for 1-m joining.

public void
setDescriptor(ClassDescriptor descriptor)

Called to set the descriptor on a Join Managerwith in a ReportItem, durring initialization, and durring DatabaseQuery.checkDescriptor.

protected void
setIsOuterJoinedAttributeQuery(boolean isOuterJoinedAttribute)

PERF: Set if the query uses any outer attribute joins, used to avoid null checks in building objects.

public void
setIsToManyJoinQuery(boolean isToManyJoin)

Set if the query uses any -m joins, and thus return duplicate/multiple rows.

public void
setJoinedAttributeExpressions_(List<E> joinedExpressions)

Set the list of expressions that represent elements that are joined because of their mapping for this query.

public void
setJoinedMappingExpressions_(List<E> joinedMappingExpressions)

Set the list of expressions that represent elements that are joined because of their mapping for this query.

public void
setJoinedMappingIndexes_(Map<K, V> joinedMappingIndexes)

Set the joined mapping indexes, used to compute mapping row partitions.

public void
setJoinedMappingQueries_(Map<K, V> joinedMappingQueries)

Set the joined mapping queries, used optimize joining, only compute the nested queries once.

public void
setJoinedMappingQueryClones(Map<K, V> joinedMappingQueryClones)

public void
setOrderByExpressions_(List<Expression> expressions)

Set the list of orderBy expressions.

public void
setParentResultIndex(int parentsResultIndex)

public void
setShouldFilterDuplicates(boolean shouldFilterDuplicates)

Set if duplicate rows should be filter when using 1-m joining.

public ForUpdateOfClause
setupLockingClauseForJoinedExpressions(ForUpdateOfClause lockingClause, AbstractSession session)

Used for joining in conjunction with pessimistic locking.

private ForUpdateOfClause
setupLockingClauseForJoinedExpressions(List<E> joinedExpressions, AbstractSession session, ForUpdateOfClause lockingClause)

Used for joining in conjunction with pessimistic locking.

public boolean
shouldFilterDuplicates()

Return if duplicate rows should be filter when using 1-m joining.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

additionalFieldExpressionsback to summary
protected transient List<Expression> additionalFieldExpressions
baseExpressionBuilderback to summary
protected ExpressionBuilder baseExpressionBuilder

Stores the base builder for resolving joined attributes by name.

baseQueryback to summary
protected ObjectBuildingQuery baseQuery

Stores the base query.

dataResultsback to summary
protected transient List<AbstractRecord> dataResults

Stored all row results to -m joining.

dataResultsByPrimaryKeyback to summary
protected transient Map<Object, List<AbstractRecord>> dataResultsByPrimaryKey

Stored all row results to -m joining by cache key.

descriptorback to summary
protected transient ClassDescriptor descriptor

Stores the descriptor that these joins apply on

hasOuterJoinedAttributeback to summary
protected boolean hasOuterJoinedAttribute

PERF: Used to avoid null checks for inner attribute joining.

isToManyJoinback to summary
protected boolean isToManyJoin

Used to determine if -m joining has been used.

joinedAggregateMappingsback to summary
protected transient List<DatabaseMapping> joinedAggregateMappings

Stores AggregateObjectMapping expressions used within local join expressions

joinedAttributeExpressionsback to summary
protected List<Expression> joinedAttributeExpressions

Stores the joined attributes added through the query

joinedAttributeMappingsback to summary
protected transient List<DatabaseMapping> joinedAttributeMappings

indexed list of mappings corresponding to

joinedAttributesback to summary
protected List<Expression> joinedAttributes

PERF: Cache the local joined attribute expressions.

joinedMappingExpressionsback to summary
protected List<Expression> joinedMappingExpressions

Stores the joined attributes as specified in the descriptor

joinedMappingIndexesback to summary
protected transient Map<DatabaseMapping, Object> joinedMappingIndexes

Used internally for joining.

joinedMappingQueriesback to summary
protected transient Map<DatabaseMapping, ObjectLevelReadQuery> joinedMappingQueries

Used internally for joining.

joinedMappingQueryClonesback to summary
protected transient Map<DatabaseMapping, ObjectLevelReadQuery> joinedMappingQueryClones

PERF: Stores the cloned joinedMappingQueries.

lastJoinedAttributeBaseExpressionback to summary
protected Expression lastJoinedAttributeBaseExpression

Stores the last used base expression while adding joined attribute expression.

orderByExpressionsback to summary
protected transient List<Expression> orderByExpressions
parentResultIndexback to summary
protected int parentResultIndex

Stores the result index of the parent, used for oneToMany joins.

shouldFilterDuplicatesback to summary
protected boolean shouldFilterDuplicates

Determine if duplicate rows should be filter when using 1-m joining.

Constructor Detail

JoinedAttributeManagerback to summary
public JoinedAttributeManager()
JoinedAttributeManagerback to summary
public JoinedAttributeManager(ClassDescriptor descriptor, ExpressionBuilder baseBuilder, ObjectBuildingQuery baseQuery)

Method Detail

addAndPrepareJoinedMappingback to summary
public Expression addAndPrepareJoinedMapping(ForeignReferenceMapping mapping, AbstractSession session)

Add the mapping for join fetch, prepare and return the join expression being used.

addExpressionAndBaseToGroupedListback to summary
protected Expression addExpressionAndBaseToGroupedList(Expression expression, List<E> expressionlist, Expression lastJoinedAttributeBaseExpression)

adds expression and its base expressions recursively to the expressionList in groups, so that an expression is never listed before its base expression

addJoinedAttributeback to summary
public void addJoinedAttribute(Expression attributeExpression)
addJoinedAttributeExpressionback to summary
public void addJoinedAttributeExpression(Expression attributeExpression)
addJoinedMappingback to summary
public void addJoinedMapping(String attributeName)

Add an attribute represented by the given attribute name to the list of joins for this query.

Note

Mapping level joins are represented separately from query level joins.

addJoinedMappingExpressionback to summary
public void addJoinedMappingExpression(Expression mappingExpression)

Add an attribute represented by the given attribute name to the list of joins for this query.

Note

Mapping level joins are represented separately from query level joins.

clearback to summary
public void clear()

Clear the joining state. This is used to redefine a queries joins for nested joins.

clearDataResultsback to summary
public void clearDataResults()

Clear the data-results for joined data for a 1-m join.

cloneback to summary
public JoinedAttributeManager clone()

Overrides java.lang.Object.clone.

Clones the Joined Attribute Manager. Generally called from Query.clone().

Returns:JoinedAttributeManager

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
computeIndexesForJoinedExpressionsback to summary
protected int computeIndexesForJoinedExpressions(final List<E> joinedExpressions, int currentIndex, final AbstractSession session)

This method is used when computing the indexes for joined mappings. It iterates through a list of join expressions and adds an index that represents where the fields represented by that expression will appear in the row returned by a read query. Method computeNestedQueriesForJoinedExpressions(List, AbstractSession, ObjectLevelReadQuery) must be already called.

Parameters
joinedExpressions:List<E>

Join expressions List.

currentIndex:int

Current joined mapping index.

session:AbstractSession

Current session.

Returns:int

Current joined mapping index updated.

computeJoiningMappingIndexesback to summary
public int computeJoiningMappingIndexes(boolean includeAllSubclassFields, AbstractSession session, int offset)

For joining the resulting rows include the field/values for many objects. As some of the objects may have the same field names, these row partitions need to be calculated. The indexes are stored in the query and used later when building the objects.

computeJoiningMappingQueriesback to summary
public void computeJoiningMappingQueries(AbstractSession session)

Used to optimize joining by pre-computing the nested join queries for the mappings.

computeNestedQueriesForJoinedExpressionsback to summary
protected void computeNestedQueriesForJoinedExpressions(List<E> joinedExpressions, AbstractSession session, ObjectLevelReadQuery readQuery)

This method is used when computing the nested queries for joined mappings. It recurses computing the nested mapping queries and their join indexes.

copyFromback to summary
public void copyFrom(JoinedAttributeManager otherJoinManager)

Copies settings from another manager. Should copy all the attributes that clone method clones.

getAdditionalFieldExpressionsback to summary
public List<Expression> getAdditionalFieldExpressions()

Get the list of additional field expressions.

getAdditionalFieldExpressions_back to summary
public List<Expression> getAdditionalFieldExpressions_()

Get the list of additional field expressions.

getBaseExpressionBuilderback to summary
public ExpressionBuilder getBaseExpressionBuilder()

Returns the base expression builder for this query.

getBaseQueryback to summary
public ObjectBuildingQuery getBaseQuery()

Returns the base query.

getDataResults_back to summary
public List<AbstractRecord> getDataResults_()

Return all of the rows fetched by the query, used for 1-m joining.

getDataResultsByPrimaryKeyback to summary
public Map<Object, List<AbstractRecord>> getDataResultsByPrimaryKey()

Return all of the rows fetched by the query by cache-key, used for 1-m joining.

getDescriptorback to summary
public ClassDescriptor getDescriptor()
getJoinedAggregateMappingsback to summary
public List<DatabaseMapping> getJoinedAggregateMappings()

Return the attributes that must be joined.

getJoinedAttributeExpressionsback to summary
public List<Expression> getJoinedAttributeExpressions()

Return the attributes that must be joined.

getJoinedAttributeMappingsback to summary
public List<DatabaseMapping> getJoinedAttributeMappings()

Return the attributes that must be joined.

getJoinedAttributesback to summary
public List<Expression> getJoinedAttributes()

Return the attributes that must be joined.

getJoinedMappingExpressionsback to summary
public List<Expression> getJoinedMappingExpressions()

Get the list of expressions that represent elements that are joined because of their mapping for this query.

getJoinedMappingIndexes_back to summary
public Map<DatabaseMapping, Object> getJoinedMappingIndexes_()

Return the joined mapping indexes, used to compute mapping row partitions.

getJoinedMappingQueries_back to summary
public Map<DatabaseMapping, ObjectLevelReadQuery> getJoinedMappingQueries_()

Return the joined mapping queries, used optimize joining, only compute the nested queries once.

getJoinedMappingQueryClonesback to summary
public Map<DatabaseMapping, ObjectLevelReadQuery> getJoinedMappingQueryClones()
getNestedJoinedMappingQueryback to summary
public ObjectLevelReadQuery getNestedJoinedMappingQuery(Expression expression)

INTERNAL: Returns the nested query corresponding to the expression. The passed expression should be either join mapping or joined attribute expression.

getOrderByExpressionsback to summary
public List<Expression> getOrderByExpressions()

Get the list of orderBy expressions.

getOrderByExpressions_back to summary
public List<Expression> getOrderByExpressions_()

Get the list of orderBy expressions.

getParentResultIndexback to summary
public int getParentResultIndex()
getValueFromObjectForExpressionback to summary
public Object getValueFromObjectForExpression(AbstractSession session, Object clone, ObjectExpression expression)

INTERNAL: Helper method to get the value from the clone for the expression passed in, triggering joins on all intermediate steps. Example expression "emp.project.pk" with a clone Employee will trigger indirection and return the project pk value.

hasAdditionalFieldExpressionsback to summary
public boolean hasAdditionalFieldExpressions()

Return if there are additional field expressions.

hasJoinedAttributeExpressionsback to summary
public boolean hasJoinedAttributeExpressions()

Return the attributes that must be joined.

hasJoinedAttributesback to summary
public boolean hasJoinedAttributes()

Return if any attributes are joined. This is a convience method that is only valid after prepare.

hasJoinedExpressionsback to summary
public boolean hasJoinedExpressions()

This method checks both attribute expressions and mapping expressions and determines if there are any joins to be made.

hasJoinedMappingExpressionsback to summary
public boolean hasJoinedMappingExpressions()

Return the attributes that must be joined.

hasOrderByExpressionsback to summary
public boolean hasOrderByExpressions()

Return if there are orderBy expressions.

hasOuterJoinedAttributeQueryback to summary
public boolean hasOuterJoinedAttributeQuery()

PERF: Return if the query uses any outer attribute joins, used to avoid null checks in building objects.

isAttributeExpressionJoinedback to summary
protected boolean isAttributeExpressionJoined(DatabaseMapping attributeMapping)

Return if the attribute is specified for joining.

isAttributeJoinedback to summary
public boolean isAttributeJoined(ClassDescriptor mappingDescriptor, DatabaseMapping attributeMapping)

Return if the attribute is specified for joining.

isAttributeMappingJoinedback to summary
protected boolean isAttributeMappingJoined(DatabaseMapping attributeMapping)

Return whether the given attribute is joined as a result of a join on a mapping

isAttributeNameInJoinedExpressionListback to summary
protected boolean isAttributeNameInJoinedExpressionList(String attributeName, List<E> joinedExpressionList)

Iterate through a list of expressions searching for the given attribute name. Return true if it is found, false otherwise.

isMappingInJoinedExpressionListback to summary
protected boolean isMappingInJoinedExpressionList(DatabaseMapping attributeMapping, List<E> joinedExpressionList)

Iterate through a list of expressions searching for the given attribute name. Return true if it is found, false otherwise. Only use if the query was preprepared so that join expressions were processed.

isToManyJoinback to summary
public boolean isToManyJoin()

Return if the query uses any -m joins, and thus return duplicate/multiple rows.

prepareJoinExpressionback to summary
protected Expression prepareJoinExpression(Expression expression, AbstractSession session)

Validate and prepare the join expression.

prepareJoinExpressionsback to summary
public void prepareJoinExpressions(AbstractSession session)

Validate and prepare join expressions.

processDataResultsback to summary
protected void processDataResults(AbstractSession session)

Process the data-results for joined data for a 1-m join. This allows all the data to be processed once, instead of n times for each object.

processDataResultsback to summary
public AbstractRecord processDataResults(AbstractRecord row, Cursor cursor, boolean forward)

Process the data-results for joined data for a 1-m join. This allows incremental processing for a cursor.

processJoinedMappingsback to summary
public void processJoinedMappings(AbstractSession session)

This method collects the Joined Mappings from the descriptor and initializes them. Excludes the mapping that are not in the passed mappingsAllowedToJoin set (if it's not null).

resetback to summary
public void reset()

Reset the JoinedAttributeManager. This will be called when the Query is re-prepared

setAdditionalFieldExpressions_back to summary
public void setAdditionalFieldExpressions_(List<Expression> expressions)

Set the list of additional field expressions.

setBaseExpressionBuilderback to summary
protected void setBaseExpressionBuilder(ExpressionBuilder builder)

This method is called from within this package, it is used when initializing a ReportItem

setBaseQueryback to summary
public void setBaseQuery(ObjectLevelReadQuery query)

This method is called from within this package it is used when initializing a report Item

setDataResultsback to summary
public void setDataResults(List<E> dataResults, AbstractSession session)

Set all of the rows fetched by the query, used for 1-m joining.

setDataResultsByPrimaryKeyback to summary
protected void setDataResultsByPrimaryKey(Map<Object, List<AbstractRecord>> dataResultsByPrimaryKey)

Set all of the rows fetched by the query by cache-key, used for 1-m joining.

setDescriptorback to summary
public void setDescriptor(ClassDescriptor descriptor)

Called to set the descriptor on a Join Managerwith in a ReportItem, durring initialization, and durring DatabaseQuery.checkDescriptor.

setIsOuterJoinedAttributeQueryback to summary
protected void setIsOuterJoinedAttributeQuery(boolean isOuterJoinedAttribute)

PERF: Set if the query uses any outer attribute joins, used to avoid null checks in building objects.

setIsToManyJoinQueryback to summary
public void setIsToManyJoinQuery(boolean isToManyJoin)

Set if the query uses any -m joins, and thus return duplicate/multiple rows.

setJoinedAttributeExpressions_back to summary
public void setJoinedAttributeExpressions_(List<E> joinedExpressions)

Set the list of expressions that represent elements that are joined because of their mapping for this query.

setJoinedMappingExpressions_back to summary
public void setJoinedMappingExpressions_(List<E> joinedMappingExpressions)

Set the list of expressions that represent elements that are joined because of their mapping for this query.

setJoinedMappingIndexes_back to summary
public void setJoinedMappingIndexes_(Map<K, V> joinedMappingIndexes)

Set the joined mapping indexes, used to compute mapping row partitions.

setJoinedMappingQueries_back to summary
public void setJoinedMappingQueries_(Map<K, V> joinedMappingQueries)

Set the joined mapping queries, used optimize joining, only compute the nested queries once.

setJoinedMappingQueryClonesback to summary
public void setJoinedMappingQueryClones(Map<K, V> joinedMappingQueryClones)
setOrderByExpressions_back to summary
public void setOrderByExpressions_(List<Expression> expressions)

Set the list of orderBy expressions.

setParentResultIndexback to summary
public void setParentResultIndex(int parentsResultIndex)
setShouldFilterDuplicatesback to summary
public void setShouldFilterDuplicates(boolean shouldFilterDuplicates)

Set if duplicate rows should be filter when using 1-m joining.

setupLockingClauseForJoinedExpressionsback to summary
public ForUpdateOfClause setupLockingClauseForJoinedExpressions(ForUpdateOfClause lockingClause, AbstractSession session)

Used for joining in conjunction with pessimistic locking. Iterate through a list of joined expressions and ensure expression is set on the locking clause for each expression that represents a pessimisically locked descriptor.

setupLockingClauseForJoinedExpressionsback to summary
private ForUpdateOfClause setupLockingClauseForJoinedExpressions(List<E> joinedExpressions, AbstractSession session, ForUpdateOfClause lockingClause)

Used for joining in conjunction with pessimistic locking. Iterate through a list of joined expressions and ensure expression is set on the locking clause for each expression that represents a pessimisically locked descriptor.

shouldFilterDuplicatesback to summary
public boolean shouldFilterDuplicates()

Return if duplicate rows should be filter when using 1-m joining.