Class MutinyQueryImpl<R>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.smallrye.mutiny.Uni<java.lang.Integer> executeUpdate()
      Asynchronously execute this delete, update, or insert query, returning the updated row count.
      org.hibernate.CacheMode getCacheMode()
      Obtain the CacheMode in effect for this query.
      java.lang.String getCacheRegion()  
      int getFirstResult()  
      org.hibernate.FlushMode getFlushMode()
      Obtain the FlushMode in effect for this query.
      int getMaxResults()  
      io.smallrye.mutiny.Uni<java.util.List<R>> getResultList()
      Asynchronously execute this query, returning the query results as a List, via a Uni.
      io.smallrye.mutiny.Uni<R> getSingleResult()
      Asynchronously execute this query, returning a single row that matches the query, throwing an exception if the query returns zero rows or more than one matching row.
      io.smallrye.mutiny.Uni<R> getSingleResultOrNull()
      Asynchronously execute this query, returning a single row that matches the query, or null if the query returns no results, throwing an exception if the query returns more than one matching row.
      boolean isCacheable()  
      boolean isReadOnly()  
      Mutiny.Query<R> setCacheable​(boolean cacheable)
      Enable or disable caching of this query result set in the second-level query cache.
      Mutiny.Query<R> setCacheMode​(org.hibernate.CacheMode cacheMode)
      Set the current CacheMode in effect while this query is being executed.
      Mutiny.Query<R> setCacheRegion​(java.lang.String cacheRegion)
      Set the name of the cache region in which to store this query result set if caching is enabled.
      Mutiny.Query<R> setComment​(java.lang.String comment)
      Set the comment for this query.
      Mutiny.Query<R> setFirstResult​(int firstResult)
      Set the position of the first result that may be returned by this query when executed, where the results are numbered from 0.
      Mutiny.Query<R> setFlushMode​(org.hibernate.FlushMode flushMode)
      Set the current FlushMode in effect while this query is being executed.
      Mutiny.Query<R> setLockMode​(java.lang.String alias, org.hibernate.LockMode lockMode)
      Set the LockMode to use for specified alias (as defined in the query's from clause).
      Mutiny.Query<R> setLockMode​(org.hibernate.LockMode lockMode)
      Set the LockMode to use for the whole query.
      Mutiny.Query<R> setLockOptions​(org.hibernate.LockOptions lockOptions)  
      Mutiny.Query<R> setMaxResults​(int maxResults)
      Set the maximum number of results that may be returned by this query when executed.
      Mutiny.Query<R> setParameter​(int position, java.lang.Object value)
      Set the value of an ordinal parameter.
      Mutiny.Query<R> setParameter​(java.lang.String name, java.lang.Object value)
      Set the value of a named parameter.
      <T> Mutiny.Query<R> setParameter​(javax.persistence.Parameter<T> name, T value)
      Set the value of a typed parameter.
      Mutiny.Query<R> setPlan​(javax.persistence.EntityGraph<R> entityGraph)
      Set the EntityGraph that will be used as a fetch plan for the root entity returned by this query.
      Mutiny.Query<R> setReadOnly​(boolean readOnly)
      Set the read-only/modifiable mode for entities and proxies loaded by this Query.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setParameter

        public Mutiny.Query<R> setParameter​(int position,
                                            java.lang.Object value)
        Description copied from interface: Mutiny.Query
        Set the value of an ordinal parameter. Ordinal parameters are numbered from 1, and are specified in the query using placeholder tokens of form ?1, ?2, etc.
        Specified by:
        setParameter in interface Mutiny.Query<R>
        Parameters:
        position - an integer identifying the ordinal parameter
        value - the argument to set
      • setParameter

        public Mutiny.Query<R> setParameter​(java.lang.String name,
                                            java.lang.Object value)
        Description copied from interface: Mutiny.Query
        Set the value of a named parameter. Named parameters are specified in the query using placeholder tokens of form :name.
        Specified by:
        setParameter in interface Mutiny.Query<R>
        Parameters:
        name - the name of the parameter
        value - the argument to set
      • setParameter

        public <T> Mutiny.Query<R> setParameter​(javax.persistence.Parameter<T> name,
                                                T value)
        Description copied from interface: Mutiny.Query
        Set the value of a typed parameter. Typed parameters are obtained from the JPA CriteriaBuilder, which may itself be obtained by calling Mutiny.SessionFactory.getCriteriaBuilder().
        Specified by:
        setParameter in interface Mutiny.Query<R>
        Parameters:
        name - the parameter
        value - the argument to set
        See Also:
        CriteriaBuilder.parameter(Class)
      • setMaxResults

        public Mutiny.Query<R> setMaxResults​(int maxResults)
        Description copied from interface: Mutiny.Query
        Set the maximum number of results that may be returned by this query when executed.
        Specified by:
        setMaxResults in interface Mutiny.Query<R>
      • getMaxResults

        public int getMaxResults()
        Specified by:
        getMaxResults in interface Mutiny.Query<R>
        Returns:
        the maximum number results, or Integer.MAX_VALUE if not set
      • setFirstResult

        public Mutiny.Query<R> setFirstResult​(int firstResult)
        Description copied from interface: Mutiny.Query
        Set the position of the first result that may be returned by this query when executed, where the results are numbered from 0.
        Specified by:
        setFirstResult in interface Mutiny.Query<R>
      • getFirstResult

        public int getFirstResult()
        Specified by:
        getFirstResult in interface Mutiny.Query<R>
        Returns:
        the first result, or 0 if not set
      • setComment

        public Mutiny.Query<R> setComment​(java.lang.String comment)
        Description copied from interface: Mutiny.Query
        Set the comment for this query. This comment will be prepended to the SQL query sent to the database.
        Specified by:
        setComment in interface Mutiny.Query<R>
        Parameters:
        comment - The human-readable comment
      • setCacheable

        public Mutiny.Query<R> setCacheable​(boolean cacheable)
        Description copied from interface: Mutiny.Query
        Enable or disable caching of this query result set in the second-level query cache.
        Specified by:
        setCacheable in interface Mutiny.Query<R>
        Parameters:
        cacheable - true if this query is cacheable
      • setCacheRegion

        public Mutiny.Query<R> setCacheRegion​(java.lang.String cacheRegion)
        Description copied from interface: Mutiny.Query
        Set the name of the cache region in which to store this query result set if caching is enabled.
        Specified by:
        setCacheRegion in interface Mutiny.Query<R>
        Parameters:
        cacheRegion - the name of the cache region
      • setLockOptions

        public Mutiny.Query<R> setLockOptions​(org.hibernate.LockOptions lockOptions)
      • setLockMode

        public Mutiny.Query<R> setLockMode​(java.lang.String alias,
                                           org.hibernate.LockMode lockMode)
        Description copied from interface: Mutiny.Query
        Set the LockMode to use for specified alias (as defined in the query's from clause).
        Specified by:
        setLockMode in interface Mutiny.Query<R>
        Parameters:
        alias - the from clause alias
        lockMode - the requested LockMode
        See Also:
        Query.setLockMode(String,LockMode)
      • setCacheMode

        public Mutiny.Query<R> setCacheMode​(org.hibernate.CacheMode cacheMode)
        Description copied from interface: Mutiny.Query
        Set the current CacheMode in effect while this query is being executed.
        Specified by:
        setCacheMode in interface Mutiny.Query<R>
      • setFlushMode

        public Mutiny.Query<R> setFlushMode​(org.hibernate.FlushMode flushMode)
        Description copied from interface: Mutiny.Query
        Set the current FlushMode in effect while this query is being executed.
        Specified by:
        setFlushMode in interface Mutiny.Query<R>
      • setPlan

        public Mutiny.Query<R> setPlan​(javax.persistence.EntityGraph<R> entityGraph)
        Description copied from interface: Mutiny.Query
        Set the EntityGraph that will be used as a fetch plan for the root entity returned by this query.
        Specified by:
        setPlan in interface Mutiny.Query<R>
      • executeUpdate

        public io.smallrye.mutiny.Uni<java.lang.Integer> executeUpdate()
        Description copied from interface: Mutiny.Query
        Asynchronously execute this delete, update, or insert query, returning the updated row count.
        Specified by:
        executeUpdate in interface Mutiny.Query<R>
        Returns:
        the row count as an integer
        See Also:
        Query.executeUpdate()
      • getSingleResult

        public io.smallrye.mutiny.Uni<R> getSingleResult()
        Description copied from interface: Mutiny.Query
        Asynchronously execute this query, returning a single row that matches the query, throwing an exception if the query returns zero rows or more than one matching row. If the query has multiple results per row, the results are returned in an instance of Object[].
        Specified by:
        getSingleResult in interface Mutiny.Query<R>
        Returns:
        the single resulting row
        See Also:
        Query.getSingleResult()
      • getSingleResultOrNull

        public io.smallrye.mutiny.Uni<R> getSingleResultOrNull()
        Description copied from interface: Mutiny.Query
        Asynchronously execute this query, returning a single row that matches the query, or null if the query returns no results, throwing an exception if the query returns more than one matching row. If the query has multiple results per row, the results are returned in an instance of Object[].
        Specified by:
        getSingleResultOrNull in interface Mutiny.Query<R>
        Returns:
        the single resulting row or null
        See Also:
        Mutiny.Query.getSingleResult()
      • getResultList

        public io.smallrye.mutiny.Uni<java.util.List<R>> getResultList()
        Description copied from interface: Mutiny.Query
        Asynchronously execute this query, returning the query results as a List, via a Uni. If the query has multiple results per row, the results are returned in an instance of Object[]. If the query has multiple results per row, the results are returned in an instance of Object[].
        Specified by:
        getResultList in interface Mutiny.Query<R>
        Returns:
        the resulting rows as a List
        See Also:
        Query.getResultList()