Class AbstractStoreQuery

java.lang.Object
org.apache.openjpa.kernel.AbstractStoreQuery
All Implemented Interfaces:
Serializable, QueryOperations, StoreQuery
Direct Known Subclasses:
ExpressionStoreQuery, MethodStoreQuery, SQLStoreQuery, StoredProcedureQuery

public abstract class AbstractStoreQuery extends Object implements StoreQuery
Abstract StoreQuery that implements most methods as no-ops.
Since:
0.4.0
Author:
Abe White
See Also:
  • Field Details

  • Constructor Details

    • AbstractStoreQuery

      public AbstractStoreQuery()
  • Method Details

    • getContext

      public QueryContext getContext()
      Description copied from interface: StoreQuery
      Return the query context that has been set.
      Specified by:
      getContext in interface StoreQuery
    • setContext

      public void setContext(QueryContext ctx)
      Description copied from interface: StoreQuery
      Set the current query context. This will be called before use.
      Specified by:
      setContext in interface StoreQuery
    • setQuery

      public boolean setQuery(Object query)
      Description copied from interface: StoreQuery
      This is invoked when the user or a facade creates a new query with an object that the system does not recognize. Return true if the object is recognized by the store, false otherwise.
      Specified by:
      setQuery in interface StoreQuery
    • getFilterListener

      public FilterListener getFilterListener(String tag)
      Description copied from interface: StoreQuery
      Return the standard filter listener for the given tag, or null.
      Specified by:
      getFilterListener in interface StoreQuery
    • getAggregateListener

      public AggregateListener getAggregateListener(String tag)
      Description copied from interface: StoreQuery
      Return the standard filter listener for the given tag, or null.
      Specified by:
      getAggregateListener in interface StoreQuery
    • newCompilationKey

      public Object newCompilationKey()
      Description copied from interface: StoreQuery
      Create a new key for caching compiled query information. May be null.
      Specified by:
      newCompilationKey in interface StoreQuery
    • newCompilation

      public Object newCompilation()
      Description copied from interface: StoreQuery
      Create a new compilation for this query. May be null.
      Specified by:
      newCompilation in interface StoreQuery
    • getCompilation

      public Object getCompilation()
      Description copied from interface: StoreQuery
      Get the current compilation for this query. If it is null, do not create.
      Specified by:
      getCompilation in interface StoreQuery
    • populateFromCompilation

      public void populateFromCompilation(Object comp)
      Description copied from interface: StoreQuery
      Populate internal data from compilation.
      Specified by:
      populateFromCompilation in interface StoreQuery
    • invalidateCompilation

      public void invalidateCompilation()
      Description copied from interface: StoreQuery
      Invalidate any internal compilation state.
      Specified by:
      invalidateCompilation in interface StoreQuery
    • supportsDataStoreExecution

      public boolean supportsDataStoreExecution()
      Description copied from interface: StoreQuery
      True if this query supports datastore execution, false if it can only run in memory.
      Specified by:
      supportsDataStoreExecution in interface StoreQuery
    • supportsInMemoryExecution

      public boolean supportsInMemoryExecution()
      Description copied from interface: StoreQuery
      True if this query supports in-memory execution, false if it can only run against the datastore.
      Specified by:
      supportsInMemoryExecution in interface StoreQuery
    • newInMemoryExecutor

      public StoreQuery.Executor newInMemoryExecutor(ClassMetaData meta, boolean subs)
      Description copied from interface: StoreQuery
      Return an executor for in-memory execution of this query. Executors must be cachable and thread safe. If this class returns true from StoreQuery.supportsAbstractExecutors(), the given metadata will always be for the candidate class of this query, or possibly null if the candidate class is not itself persistence capable (like an interface or abstract base class). Otherwise, the given type will be a mapped class.
      Specified by:
      newInMemoryExecutor in interface StoreQuery
      subs - whether to include dependent mapped subclasses in the results; independent subclasses should never be included
    • newDataStoreExecutor

      public StoreQuery.Executor newDataStoreExecutor(ClassMetaData meta, boolean subs)
      Description copied from interface: StoreQuery
      Return an executor for datastore execution of this query. Executors must be cachable and thread safe. If this class returns true from StoreQuery.supportsAbstractExecutors(), the given metadata will always be for the candidate class of this query, or possibly null if the candidate class is not itself persistence capable (like an interface or abstract base class). Otherwise, the given type will be a mapped class.
      Specified by:
      newDataStoreExecutor in interface StoreQuery
      subs - whether to include dependent mapped subclasses in the results; independent subclasses should never be included
    • supportsAbstractExecutors

      public boolean supportsAbstractExecutors()
      Description copied from interface: StoreQuery
      Return true if this query supports execution against abstract or interface types. Returns false by default, meaning we will only request executors for persistent classes. In this case, we will automatically combine the results of the executors for all implementing classes if we execute a query for an interface for abstract type.
      Specified by:
      supportsAbstractExecutors in interface StoreQuery
    • requiresCandidateType

      public boolean requiresCandidateType()
      Description copied from interface: StoreQuery
      Whether this query requires a candidate class.
      Specified by:
      requiresCandidateType in interface StoreQuery
    • requiresParameterDeclarations

      public boolean requiresParameterDeclarations()
      Description copied from interface: StoreQuery
      Whether this query requires parameters to be declared.
      Specified by:
      requiresParameterDeclarations in interface StoreQuery
    • supportsParameterDeclarations

      public boolean supportsParameterDeclarations()
      Description copied from interface: StoreQuery
      Whether this query supports declared parameters.
      Specified by:
      supportsParameterDeclarations in interface StoreQuery
    • evaluate

      public Object evaluate(Object value, Object ob, Object[] params, OpenJPAStateManager sm)
      Specified by:
      evaluate in interface StoreQuery