接口 QueryProducer

    • 方法详细资料

      • getNamedQuery

        Query getNamedQuery​(String queryName)
        Create a Query instance for the named query.
        参数:
        queryName - the name of a pre-defined, named query
        返回:
        The Query instance for manipulation and execution
        抛出:
        IllegalArgumentException - if a query has not been defined with the given name or if the query string is found to be invalid
      • createQuery

        Query createQuery​(String queryString)
        Create a Query instance for the given HQL/JPQL query string.
        参数:
        queryString - The HQL/JPQL query
        返回:
        The Query instance for manipulation and execution
        另请参阅:
        EntityManager.createQuery(String)
      • createQuery

        <R> Query<R> createQuery​(String queryString,
                                 Class<R> resultClass)
        Create a typed Query instance for the given HQL/JPQL query string.
        参数:
        queryString - The HQL/JPQL query
        返回:
        The Query instance for manipulation and execution
        另请参阅:
        EntityManager.createQuery(String,Class)
      • createNamedQuery

        Query createNamedQuery​(String name)
        The JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.
        参数:
        name - the name of a pre-defined, named query
        返回:
        The Query instance for manipulation and execution
        抛出:
        IllegalArgumentException - if a query has not been defined with the given name or if the query string is found to be invalid
        另请参阅:
        EntityManager.createNamedQuery(String)
      • createNamedQuery

        <R> Query<R> createNamedQuery​(String name,
                                      Class<R> resultClass)
        The JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).
        参数:
        name - the name of a query defined in metadata
        resultClass - the type of the query result
        返回:
        The Query instance for manipulation and execution
        抛出:
        IllegalArgumentException - if a query has not been defined with the given name or if the query string is found to be invalid or if the query result is found to not be assignable to the specified type
        另请参阅:
        EntityManager.createNamedQuery(String,Class)
      • createSQLQuery

        @Deprecated
        default SQLQuery createSQLQuery​(String queryString)
        已过时。
        (since 5.2) use createNativeQuery(String) instead
        Create a NativeQuery instance for the given SQL query string.
        参数:
        queryString - The SQL query
        返回:
        The query instance for manipulation and execution
      • createNativeQuery

        NativeQuery createNativeQuery​(String sqlString)
        Create a NativeQuery instance for the given native (SQL) query
        参数:
        sqlString - a native SQL query string
        返回:
        The NativeQuery instance for manipulation and execution
        另请参阅:
        EntityManager.createNativeQuery(String)
      • createNativeQuery

        <R> NativeQuery<R> createNativeQuery​(String sqlString,
                                             Class<R> resultClass)
        Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.
        参数:
        sqlString - Native (SQL) query string
        resultClass - The Java type to map results to
        返回:
        The NativeQuery instance for manipulation and execution
        另请参阅:
        EntityManager.createNativeQuery(String,Class)
      • createNativeQuery

        NativeQuery createNativeQuery​(String sqlString,
                                      String resultSetMapping)
        Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.
        参数:
        sqlString - Native (SQL) query string
        resultSetMapping - The explicit (named) result mapping
        返回:
        The NativeQuery instance for manipulation and execution
        另请参阅:
        EntityManager.createNativeQuery(String,Class), SqlResultSetMapping
      • getNamedSQLQuery

        @Deprecated
        default Query getNamedSQLQuery​(String name)
        已过时。
        (since 5.2) use getNamedNativeQuery(String) instead
        Get a NativeQuery instance for a named native SQL query
        参数:
        name - The name of the pre-defined query
        返回:
        The NativeQuery instance for manipulation and execution
      • getNamedNativeQuery

        NativeQuery getNamedNativeQuery​(String name)
        Get a NativeQuery instance for a named native SQL query
        参数:
        name - The name of the pre-defined query
        返回:
        The NativeQuery instance for manipulation and execution
      • createQuery

        <T> Query<T> createQuery​(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
      • createQuery

        Query createQuery​(javax.persistence.criteria.CriteriaUpdate updateQuery)
      • createQuery

        Query createQuery​(javax.persistence.criteria.CriteriaDelete deleteQuery)