Package org.eclipse.persistence.queries
Class BatchFetchPolicy
- java.lang.Object
-
- org.eclipse.persistence.queries.BatchFetchPolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class BatchFetchPolicy extends java.lang.Object implements java.io.Serializable, java.lang.CloneableBatchFetchPolicy defines batch reading configuration.- See Also:
ObjectLevelReadQuery.setBatchFetchPolicy(BatchFetchPolicy), Serialized Form- Author:
- James Sutherland
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Expression>attributeExpressionsDefine the attributes to be batch fetched.protected java.util.List<java.lang.String>attributesPERF: Cache the local batch read attribute names.protected java.util.List<DatabaseMapping>batchedMappingsDefine the mapping to be batch fetched (from mapping settings).protected java.util.Map<java.lang.Object,java.lang.Object>batchObjectsStores temporary map of batched objects (this queries results).protected java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>>dataResultsStores temporary list of rows from parent batch query per batched mapping.protected java.util.Map<DatabaseMapping,ReadQuery>mappingQueriesPERF: Used internally to store the prepared mapping queries.protected intsizeDefine the batch size for IN style batch fetching.protected BatchFetchTypetypeDefine the type of batch fetching to use.
-
Constructor Summary
Constructors Constructor Description BatchFetchPolicy()BatchFetchPolicy(BatchFetchType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDataResults(org.eclipse.persistence.internal.sessions.AbstractRecord row)INTERNAL: Add the row to the set of data results.BatchFetchPolicyclone()java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>getAllDataResults()INTERNAL: Return temporary list of rows from parent batch query per batched mapping.java.util.List<Expression>getAttributeExpressions()INTERNAL: Return all attributes specified for batch reading.java.util.List<java.lang.String>getAttributes()INTERNAL: PERF: Return the cached local (only) batch read attribute names.java.util.List<DatabaseMapping>getBatchedMappings()INTERNAL: Return any mappings that are always batched.java.util.Map<java.lang.Object,java.lang.Object>getBatchObjects()INTERNAL: Return temporary map of batched objects.java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>>getDataResults()INTERNAL: Return temporary list of rows from parent batch query per batched mapping.java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>getDataResults(DatabaseMapping mapping)INTERNAL: Return the remaining data results for the mapping.java.util.Map<DatabaseMapping,ReadQuery>getMappingQueries()INTERNAL: PERF: Return the internally stored prepared mapping queries.intgetSize()Return the batch fetch size.BatchFetchTypegetType()Return the batch fetch type, (JOIN, IN, EXISTS).booleanhasAttributes()INTERNAL: Return true is this query has batchingbooleanisAttributeBatchRead(java.lang.String attributeName)INTERNAL: Return if the attribute is specified for batch reading.booleanisAttributeBatchRead(ClassDescriptor mappingDescriptor, java.lang.String attributeName)INTERNAL: Return if the attribute is specified for batch reading.booleanisEXISTS()Return if using the EXISTS fetch type.booleanisIN()Return if using the IN fetch type.booleanisJOIN()Return if using the JOIN fetch type.voidsetAttributeExpressions(java.util.List<Expression> attributeExpressions)voidsetAttributes(java.util.List<java.lang.String> attributes)INTERNAL: PERF: Set the cached local (only) batch read attribute names.voidsetBatchedMappings(java.util.List<DatabaseMapping> batchedMappings)INTERNAL: Set any mappings that are always batched.voidsetBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)INTERNAL: Set temporary map of batched objects.voidsetDataResults(java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> rows)INTERNAL: Set the rows to the set of data results for each mapping.voidsetDataResults(java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>> dataResults)INTERNAL: Set temporary list of rows from parent batch query per batched mapping.voidsetDataResults(DatabaseMapping mapping, java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> rows)INTERNAL: Set the remaining data results for the mapping.voidsetMappingQueries(java.util.Map<DatabaseMapping,ReadQuery> mappingQueries)INTERNAL: PERF: Set the internally stored prepared mapping queries.voidsetSize(int size)Set the batch fetch size.voidsetType(BatchFetchType type)Set the batch fetch type, (JOIN, IN, EXISTS).
-
-
-
Field Detail
-
type
protected BatchFetchType type
Define the type of batch fetching to use.
-
size
protected int size
Define the batch size for IN style batch fetching.
-
attributeExpressions
protected java.util.List<Expression> attributeExpressions
Define the attributes to be batch fetched.
-
batchedMappings
protected java.util.List<DatabaseMapping> batchedMappings
Define the mapping to be batch fetched (from mapping settings).
-
mappingQueries
protected transient java.util.Map<DatabaseMapping,ReadQuery> mappingQueries
PERF: Used internally to store the prepared mapping queries.
-
attributes
protected java.util.List<java.lang.String> attributes
PERF: Cache the local batch read attribute names.
-
dataResults
protected transient java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>> dataResults
Stores temporary list of rows from parent batch query per batched mapping.
-
batchObjects
protected transient java.util.Map<java.lang.Object,java.lang.Object> batchObjects
Stores temporary map of batched objects (this queries results).
-
-
Constructor Detail
-
BatchFetchPolicy
public BatchFetchPolicy()
-
BatchFetchPolicy
public BatchFetchPolicy(BatchFetchType type)
-
-
Method Detail
-
clone
public BatchFetchPolicy clone()
- Overrides:
clonein classjava.lang.Object
-
isIN
public boolean isIN()
Return if using the IN fetch type.
-
isJOIN
public boolean isJOIN()
Return if using the JOIN fetch type.
-
isEXISTS
public boolean isEXISTS()
Return if using the EXISTS fetch type.
-
getType
public BatchFetchType getType()
Return the batch fetch type, (JOIN, IN, EXISTS).
-
setType
public void setType(BatchFetchType type)
Set the batch fetch type, (JOIN, IN, EXISTS).
-
getSize
public int getSize()
Return the batch fetch size.
-
setSize
public void setSize(int size)
Set the batch fetch size.
-
getMappingQueries
public java.util.Map<DatabaseMapping,ReadQuery> getMappingQueries()
INTERNAL: PERF: Return the internally stored prepared mapping queries.
-
setMappingQueries
public void setMappingQueries(java.util.Map<DatabaseMapping,ReadQuery> mappingQueries)
INTERNAL: PERF: Set the internally stored prepared mapping queries.
-
getAttributes
public java.util.List<java.lang.String> getAttributes()
INTERNAL: PERF: Return the cached local (only) batch read attribute names.
-
setAttributes
public void setAttributes(java.util.List<java.lang.String> attributes)
INTERNAL: PERF: Set the cached local (only) batch read attribute names.
-
setAttributeExpressions
public void setAttributeExpressions(java.util.List<Expression> attributeExpressions)
-
getAttributeExpressions
public java.util.List<Expression> getAttributeExpressions()
INTERNAL: Return all attributes specified for batch reading.
-
hasAttributes
public boolean hasAttributes()
INTERNAL: Return true is this query has batching
-
getBatchedMappings
public java.util.List<DatabaseMapping> getBatchedMappings()
INTERNAL: Return any mappings that are always batched.
-
setBatchedMappings
public void setBatchedMappings(java.util.List<DatabaseMapping> batchedMappings)
INTERNAL: Set any mappings that are always batched.
-
isAttributeBatchRead
public boolean isAttributeBatchRead(java.lang.String attributeName)
INTERNAL: Return if the attribute is specified for batch reading.
-
isAttributeBatchRead
public boolean isAttributeBatchRead(ClassDescriptor mappingDescriptor, java.lang.String attributeName)
INTERNAL: Return if the attribute is specified for batch reading.
-
addDataResults
public void addDataResults(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Add the row to the set of data results. This is used for IN batching in batches.
-
getDataResults
public java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> getDataResults(DatabaseMapping mapping)
INTERNAL: Return the remaining data results for the mapping. This is used for IN batching in batches.
-
setDataResults
public void setDataResults(DatabaseMapping mapping, java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> rows)
INTERNAL: Set the remaining data results for the mapping. This is used for IN batching in batches.
-
setDataResults
public void setDataResults(java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> rows)
INTERNAL: Set the rows to the set of data results for each mapping. This is used for IN batching in batches.
-
getAllDataResults
public java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord> getAllDataResults()
INTERNAL: Return temporary list of rows from parent batch query per batched mapping. This is used for IN batching in batches.
-
getDataResults
public java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>> getDataResults()
INTERNAL: Return temporary list of rows from parent batch query per batched mapping. This is used for IN batching in batches.
-
setDataResults
public void setDataResults(java.util.Map<java.lang.Object,java.util.List<org.eclipse.persistence.internal.sessions.AbstractRecord>> dataResults)
INTERNAL: Set temporary list of rows from parent batch query per batched mapping. This is used for IN batching in batches.
-
getBatchObjects
public java.util.Map<java.lang.Object,java.lang.Object> getBatchObjects()
INTERNAL: Return temporary map of batched objects.
-
setBatchObjects
public void setBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)
INTERNAL: Set temporary map of batched objects.
-
-