Package org.hibernate

Interface BasicQueryContract<T extends BasicQueryContract>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      CacheMode getCacheMode()
      Deprecated.
      Obtain the CacheMode in effect for this query.
      java.lang.String getCacheRegion()
      Deprecated.
      Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion on isCacheable() for more information).
      java.lang.Integer getFetchSize()
      Deprecated.
      Obtain the JDBC fetch size hint in effect for this query.
      FlushMode getHibernateFlushMode()
      Deprecated.
      Obtain the FlushMode in effect for this query.
      Type[] getReturnTypes()
      Deprecated.
      (since 5.2) with no replacement; to be removed in 6.0
      java.lang.Integer getTimeout()
      Deprecated.
      Obtain the query timeout in seconds.
      boolean isCacheable()
      Deprecated.
      Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections.
      boolean isReadOnly()
      Deprecated.
      Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.
      T setCacheable​(boolean cacheable)
      Deprecated.
      Enable/disable second level query (result) caching for this query.
      T setCacheMode​(CacheMode cacheMode)
      Deprecated.
      (Re)set the current CacheMode in effect for this query.
      T setCacheRegion​(java.lang.String cacheRegion)
      Deprecated.
      Set the name of the cache region where query results should be cached (if cached at all).
      T setFetchSize​(int fetchSize)
      Deprecated.
      Sets a JDBC fetch size hint for the query.
      default BasicQueryContract setFlushMode​(FlushMode flushMode)
      Deprecated.
      T setHibernateFlushMode​(FlushMode flushMode)
      Deprecated.
      (Re)set the current FlushMode in effect for this query.
      T setReadOnly​(boolean readOnly)
      Deprecated.
      Set the read-only/modifiable mode for entities and proxies loaded by this Query.
      T setTimeout​(int timeout)
      Deprecated.
      Set the query timeout in seconds.
    • Method Detail

      • getHibernateFlushMode

        FlushMode getHibernateFlushMode()
        Deprecated.
        Obtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session from which it originates.
        Returns:
        The query FlushMode.
        See Also:
        Session.getFlushMode(), FlushMode
      • setHibernateFlushMode

        T setHibernateFlushMode​(FlushMode flushMode)
        Deprecated.
        (Re)set the current FlushMode in effect for this query.
        Parameters:
        flushMode - The new FlushMode to use.
        Returns:
        this, for method chaining
        See Also:
        getHibernateFlushMode()
      • getCacheMode

        CacheMode getCacheMode()
        Deprecated.
        Obtain the CacheMode in effect for this query. By default, the query inherits the CacheMode of the Session from which is originates. NOTE: The CacheMode here only effects reading/writing of the query cache, not the entity/collection caches.
        Returns:
        The query CacheMode.
        See Also:
        Session.getCacheMode(), CacheMode
      • setCacheMode

        T setCacheMode​(CacheMode cacheMode)
        Deprecated.
        (Re)set the current CacheMode in effect for this query.
        Parameters:
        cacheMode - The new CacheMode to use.
        Returns:
        this, for method chaining
        See Also:
        getCacheMode()
      • isCacheable

        boolean isCacheable()
        Deprecated.
        Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections. NOTE: the query being "eligible" for caching does not necessarily mean its results will be cached. Second level query caching still has to be enabled on the SessionFactory for this to happen. Usually that is controlled by the hibernate.cache.use_query_cache configuration setting.
        Returns:
        true if the query results are eligible for caching, false otherwise.
        See Also:
        AvailableSettings.USE_QUERY_CACHE
      • setCacheable

        T setCacheable​(boolean cacheable)
        Deprecated.
        Enable/disable second level query (result) caching for this query.
        Parameters:
        cacheable - Should the query results be cacheable?
        Returns:
        this, for method chaining
        See Also:
        isCacheable()
      • getCacheRegion

        java.lang.String getCacheRegion()
        Deprecated.
        Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion on isCacheable() for more information). null indicates that the default region should be used.
        Returns:
        The specified cache region name into which query results should be placed; null indicates the default region.
      • setCacheRegion

        T setCacheRegion​(java.lang.String cacheRegion)
        Deprecated.
        Set the name of the cache region where query results should be cached (if cached at all).
        Parameters:
        cacheRegion - the name of a query cache region, or null to indicate that the default region should be used.
        Returns:
        this, for method chaining
        See Also:
        getCacheRegion()
      • getTimeout

        java.lang.Integer getTimeout()
        Deprecated.
        Obtain the query timeout in seconds. This value is eventually passed along to the JDBC query via Statement.setQueryTimeout(int). Zero indicates no timeout.
        Returns:
        The timeout in seconds
        See Also:
        Statement.getQueryTimeout(), Statement.setQueryTimeout(int)
      • setTimeout

        T setTimeout​(int timeout)
        Deprecated.
        Set the query timeout in seconds. NOTE it is important to understand that any value set here is eventually passed directly through to the JDBC Statement which expressly disallows negative values. So negative values should be avoided as a general rule.
        Parameters:
        timeout - the timeout in seconds
        Returns:
        this, for method chaining
        See Also:
        getTimeout()
      • getFetchSize

        java.lang.Integer getFetchSize()
        Deprecated.
        Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC query via Statement.setFetchSize(int). As defined by JDBC, this value is a hint to the driver to indicate how many rows to fetch from the database when more rows are needed. NOTE : JDBC expressly defines this value as a hint. It may or may not have any effect on the actual query execution and ResultSet processing depending on the driver.
        Returns:
        The timeout in seconds
        See Also:
        Statement.getFetchSize(), Statement.setFetchSize(int)
      • setFetchSize

        T setFetchSize​(int fetchSize)
        Deprecated.
        Sets a JDBC fetch size hint for the query.
        Parameters:
        fetchSize - the fetch size hint
        Returns:
        this, for method chaining
        See Also:
        getFetchSize()
      • getReturnTypes

        @Deprecated
        Type[] getReturnTypes()
        Deprecated.
        (since 5.2) with no replacement; to be removed in 6.0
        Return the Hibernate types of the query results.
        Returns:
        an array of types