Class AbstractJavaQuery<T>

java.lang.Object
org.datanucleus.store.query.Query<T>
org.datanucleus.store.query.AbstractJavaQuery<T>
All Implemented Interfaces:
Serializable, ExecutionContextListener
Direct Known Subclasses:
AbstractJDOQLQuery, AbstractJPQLQuery

public abstract class AbstractJavaQuery<T> extends Query<T>
Abstract representation of a Java-based query. To be extended by Java-based query languages.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • candidateCollection

      protected transient Collection<T> candidateCollection
      Collection of candidates for this query.
    • singleString

      protected String singleString
      Cached form of the single string form of the query.
  • Constructor Details

    • AbstractJavaQuery

      public AbstractJavaQuery(StoreManager storeMgr, ExecutionContext ec)
      Constructor for a Java-based query.
      Parameters:
      storeMgr - StoreManager for this query
      ec - ExecutionContext
  • Method Details

    • setCandidates

      public void setCandidates(Extent<T> pcs)
      Set the candidate Extent to query. Passing in null clears off the current candidate Extent.
      Specified by:
      setCandidates in class Query<T>
      Parameters:
      pcs - the Candidate Extent.
    • setCandidates

      public void setCandidates(Collection<T> pcs)
      Set the candidate collection to query. Passing in null clears off the current candidate collection.
      Specified by:
      setCandidates in class Query<T>
      Parameters:
      pcs - the Candidate collection.
    • discardCompiled

      protected void discardCompiled()
      Method to discard our current compiled query due to changes.
      Overrides:
      discardCompiled in class Query<T>
      See Also:
    • compileGeneric

      public abstract void compileGeneric(Map<Object,Object> parameterValues)
      Method to generate the generic compilation of this query.
      Parameters:
      parameterValues - Values for any parameters
    • performDeletePersistentAll

      protected long performDeletePersistentAll(Map parameters)
      Execute the query to delete persistent objects.
      Overrides:
      performDeletePersistentAll in class Query<T>
      Parameters:
      parameters - the Map containing all of the parameters.
      Returns:
      the number of deleted objects.
    • getSingleStringQuery

      public abstract String getSingleStringQuery()
      Accessor for a single string form of the query.
      Returns:
      Single string form of the query.
    • toString

      public String toString()
      Stringifier method
      Overrides:
      toString in class Object
      Returns:
      Single-string form of this query.
    • evaluateInMemory

      protected boolean evaluateInMemory()
      Convenience method to return whether the query should be evaluated in-memory.
      Returns:
      Use in-memory evaluation?
    • dereferenceFilter

      protected String dereferenceFilter(String input)
      Method to expand the subqueries defined in a filter.
      Parameters:
      input - the input string
      Returns:
      The filter expanded