Class QueryImpl<X>

  • All Implemented Interfaces:
    jakarta.persistence.Query, jakarta.persistence.TypedQuery<X>, java.io.Serializable, OpenJPAQuery<X>, OpenJPAQuerySPI<X>

    public class QueryImpl<X>
    extends AbstractQuery<X>
    implements java.io.Serializable
    Implementation of Query interface.
    Author:
    Marc Prud'hommeaux, Abe White
    See Also:
    Serialized Form
    • Method Detail

      • getDelegate

        public Query getDelegate()
        Delegate.
      • getIgnoreChanges

        public boolean getIgnoreChanges()
        Description copied from interface: OpenJPAQuery
        Whether to ignore changes in the current transaction.
        Specified by:
        getIgnoreChanges in interface OpenJPAQuery<X>
      • getCandidateCollection

        public java.util.Collection<?> getCandidateCollection()
        Description copied from interface: OpenJPAQuery
        Return the candidate collection, or null if an extent was specified instead of a collection.
        Specified by:
        getCandidateCollection in interface OpenJPAQuery<X>
      • hasSubclasses

        public boolean hasSubclasses()
        Description copied from interface: OpenJPAQuery
        Whether subclasses are included in the query results.
        Specified by:
        hasSubclasses in interface OpenJPAQuery<X>
      • getFirstResult

        public int getFirstResult()
        Description copied from interface: OpenJPAQuery
        Return the 0-based start index for the returned results.
        Specified by:
        getFirstResult in interface OpenJPAQuery<X>
        Specified by:
        getFirstResult in interface jakarta.persistence.Query
      • setFirstResult

        public OpenJPAQuery<X> setFirstResult​(int startPosition)
        Specified by:
        setFirstResult in interface OpenJPAQuery<X>
        Specified by:
        setFirstResult in interface jakarta.persistence.Query
        Specified by:
        setFirstResult in interface jakarta.persistence.TypedQuery<X>
      • getMaxResults

        public int getMaxResults()
        Description copied from interface: OpenJPAQuery
        Return the maximum number of results to retrieve. or Integer.MAX_VALUE for no limit.
        Specified by:
        getMaxResults in interface OpenJPAQuery<X>
        Specified by:
        getMaxResults in interface jakarta.persistence.Query
      • setMaxResults

        public OpenJPAQuery<X> setMaxResults​(int max)
        Specified by:
        setMaxResults in interface OpenJPAQuery<X>
        Specified by:
        setMaxResults in interface jakarta.persistence.Query
        Specified by:
        setMaxResults in interface jakarta.persistence.TypedQuery<X>
      • getResultList

        public java.util.List getResultList()
        Specified by:
        getResultList in interface jakarta.persistence.Query
        Specified by:
        getResultList in interface jakarta.persistence.TypedQuery<X>
      • getSingleResult

        public X getSingleResult()
        Execute a query that returns a single result.
        Specified by:
        getSingleResult in interface jakarta.persistence.Query
        Specified by:
        getSingleResult in interface jakarta.persistence.TypedQuery<X>
      • executeUpdate

        public int executeUpdate()
        Specified by:
        executeUpdate in interface jakarta.persistence.Query
      • getFlushMode

        public jakarta.persistence.FlushModeType getFlushMode()
        Description copied from interface: OpenJPAQuery
        Return the current flush mode.
        Specified by:
        getFlushMode in interface OpenJPAQuery<X>
        Specified by:
        getFlushMode in interface jakarta.persistence.Query
      • setFlushMode

        public OpenJPAQuery<X> setFlushMode​(jakarta.persistence.FlushModeType flushMode)
        Specified by:
        setFlushMode in interface OpenJPAQuery<X>
        Specified by:
        setFlushMode in interface jakarta.persistence.Query
        Specified by:
        setFlushMode in interface jakarta.persistence.TypedQuery<X>
      • getDataStoreActions

        public java.lang.String[] getDataStoreActions​(java.util.Map params)
        Description copied from interface: OpenJPAQuery
        Returns a description of the commands that will be sent to the datastore in order to execute this query. This will typically be in the native query language of the database (e.g., SQL).
        Specified by:
        getDataStoreActions in interface OpenJPAQuery<X>
        Parameters:
        params - the named parameter map for the query invocation
      • getLockMode

        public jakarta.persistence.LockModeType getLockMode()
        Specified by:
        getLockMode in interface jakarta.persistence.Query
      • setLockMode

        public jakarta.persistence.TypedQuery<X> setLockMode​(jakarta.persistence.LockModeType lockMode)
        Sets lock mode on the given query. If the target query has been prepared and cached, then ignores the cached version.
        Specified by:
        setLockMode in interface jakarta.persistence.Query
        Specified by:
        setLockMode in interface jakarta.persistence.TypedQuery<X>
        See Also:
        ignorePreparedQuery()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • getHints

        public java.util.Map<java.lang.String,​java.lang.Object> getHints()
        Get all the active hints and their values.
        Specified by:
        getHints in interface jakarta.persistence.Query
      • setHint

        public OpenJPAQuery<X> setHint​(java.lang.String key,
                                       java.lang.Object value)
        Specified by:
        setHint in interface OpenJPAQuery<X>
        Specified by:
        setHint in interface jakarta.persistence.Query
        Specified by:
        setHint in interface jakarta.persistence.TypedQuery<X>
      • getSupportedHints

        public java.util.Set<java.lang.String> getSupportedHints()
        Description copied from interface: OpenJPAQuery
        Gets hints supported by this query.
        Specified by:
        getSupportedHints in interface OpenJPAQuery<X>
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> cls)
        Unwraps this receiver to an instance of the given class, if possible.
        Specified by:
        unwrap in interface jakarta.persistence.Query
        Since:
        2.0.0
      • getParamTypes

        public OrderedMap<java.lang.Object,​java.lang.Class<?>> getParamTypes()
        Specified by:
        getParamTypes in class AbstractQuery<X>
        Returns:
        a map of parameter name to type for this query.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object