Class BatchFetchPolicy

java.lang.Object
org.eclipse.persistence.queries.BatchFetchPolicy
All Implemented Interfaces:
Serializable, Cloneable

public class BatchFetchPolicy extends Object implements Serializable, Cloneable
BatchFetchPolicy defines batch reading configuration.
See Also:
Author:
James Sutherland
  • Field Details

    • 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 List<Expression> attributeExpressions
      Define the attributes to be batch fetched.
    • batchedMappings

      protected List<DatabaseMapping> batchedMappings
      Define the mapping to be batch fetched (from mapping settings).
    • mappingQueries

      protected transient Map<DatabaseMapping,ReadQuery> mappingQueries
      PERF: Used internally to store the prepared mapping queries.
    • attributes

      protected List<String> attributes
      PERF: Cache the local batch read attribute names.
    • dataResults

      protected transient Map<Object,List<org.eclipse.persistence.internal.sessions.AbstractRecord>> dataResults
      Stores temporary list of rows from parent batch query per batched mapping.
    • batchObjects

      protected transient Map<Object,Object> batchObjects
      Stores temporary map of batched objects (this queries results).
  • Constructor Details

    • BatchFetchPolicy

      public BatchFetchPolicy()
    • BatchFetchPolicy

      public BatchFetchPolicy(BatchFetchType type)
  • Method Details

    • clone

      public BatchFetchPolicy clone()
      Overrides:
      clone in class 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 Map<DatabaseMapping,ReadQuery> getMappingQueries()
      INTERNAL: PERF: Return the internally stored prepared mapping queries.
    • setMappingQueries

      public void setMappingQueries(Map<DatabaseMapping,ReadQuery> mappingQueries)
      INTERNAL: PERF: Set the internally stored prepared mapping queries.
    • getAttributes

      public List<String> getAttributes()
      INTERNAL: PERF: Return the cached local (only) batch read attribute names.
    • setAttributes

      public void setAttributes(List<String> attributes)
      INTERNAL: PERF: Set the cached local (only) batch read attribute names.
    • setAttributeExpressions

      public void setAttributeExpressions(List<Expression> attributeExpressions)
    • getAttributeExpressions

      public 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 List<DatabaseMapping> getBatchedMappings()
      INTERNAL: Return any mappings that are always batched.
    • setBatchedMappings

      public void setBatchedMappings(List<DatabaseMapping> batchedMappings)
      INTERNAL: Set any mappings that are always batched.
    • isAttributeBatchRead

      public boolean isAttributeBatchRead(String attributeName)
      INTERNAL: Return if the attribute is specified for batch reading.
    • isAttributeBatchRead

      public boolean isAttributeBatchRead(ClassDescriptor mappingDescriptor, 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 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, 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(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 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 Map<Object,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(Map<Object,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 Map<Object,Object> getBatchObjects()
      INTERNAL: Return temporary map of batched objects.
    • setBatchObjects

      public void setBatchObjects(Map<Object,Object> batchObjects)
      INTERNAL: Set temporary map of batched objects.