Class NamedQueryDefinition

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    NamedSQLQueryDefinition

    public class NamedQueryDefinition
    extends Object
    implements Serializable
    Definition of a named query, defined in the mapping metadata. Additionally, as of JPA 2.1, named query definition can also come from a compiled query.
    See Also:
    Serialized Form
    • Constructor Detail

      • NamedQueryDefinition

        @Deprecated
        public NamedQueryDefinition​(String name,
                                    String query,
                                    boolean cacheable,
                                    String cacheRegion,
                                    Integer timeout,
                                    Integer fetchSize,
                                    FlushMode flushMode,
                                    CacheMode cacheMode,
                                    boolean readOnly,
                                    String comment,
                                    Map parameterTypes)
        Deprecated.
        This form is used to bind named queries from Hibernate metadata, both hbm.xml files and NamedQuery annotation.
        Parameters:
        name - The name under which to key/register the query
        query - The query string.
        cacheable - Is the query cacheable?
        cacheRegion - If cacheable, was there a specific region named?
        timeout - Query timeout, null indicates no timeout
        fetchSize - Fetch size associated with the query, null indicates no limit
        flushMode - Flush mode associated with query
        cacheMode - Cache mode associated with query
        readOnly - Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?
        comment - SQL comment to be used in the generated SQL, null indicates none
        parameterTypes - (no idea, afaict this is always passed as null)
      • NamedQueryDefinition

        @Deprecated
        public NamedQueryDefinition​(String name,
                                    String query,
                                    boolean cacheable,
                                    String cacheRegion,
                                    Integer timeout,
                                    Integer lockTimeout,
                                    Integer fetchSize,
                                    FlushMode flushMode,
                                    CacheMode cacheMode,
                                    boolean readOnly,
                                    String comment,
                                    Map parameterTypes)
        Deprecated.
        This version is used to bind named queries defined via NamedQuery.
        Parameters:
        name - The name under which to key/register the query
        query - The query string.
        cacheable - Is the query cacheable?
        cacheRegion - If cacheable, was there a specific region named?
        timeout - Query timeout, null indicates no timeout
        lockTimeout - Specifies the lock timeout for queries that apply lock modes.
        fetchSize - Fetch size associated with the query, null indicates no limit
        flushMode - Flush mode associated with query
        cacheMode - Cache mode associated with query
        readOnly - Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?
        comment - SQL comment to be used in the generated SQL, null indicates none
        parameterTypes - (no idea, afaict this is always passed as null)
    • Method Detail

      • getName

        public String getName()
      • getQueryString

        public String getQueryString()
      • isCacheable

        public boolean isCacheable()
      • getCacheRegion

        public String getCacheRegion()
      • getFetchSize

        public Integer getFetchSize()
      • getTimeout

        public Integer getTimeout()
      • getFlushMode

        public FlushMode getFlushMode()
      • getParameterTypes

        public Map getParameterTypes()
      • getQuery

        public String getQuery()
      • getCacheMode

        public CacheMode getCacheMode()
      • isReadOnly

        public boolean isReadOnly()
      • getComment

        public String getComment()
      • getFirstResult

        public Integer getFirstResult()
      • getMaxResults

        public Integer getMaxResults()
      • getPassDistinctThrough

        public Boolean getPassDistinctThrough()