Interface QueryProducer

    • Method Detail

      • getNamedQuery

        Query getNamedQuery​(String queryName)
        Create a Query instance for the named query.
        Parameters:
        queryName - the name of a pre-defined, named query
        Returns:
        The Query instance for manipulation and execution
        Throws:
        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.
        Parameters:
        queryString - The HQL/JPQL query
        Returns:
        The Query instance for manipulation and execution
        See Also:
        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.
        Parameters:
        queryString - The HQL/JPQL query
        Returns:
        The Query instance for manipulation and execution
        See Also:
        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.
        Parameters:
        name - the name of a pre-defined, named query
        Returns:
        The Query instance for manipulation and execution
        Throws:
        IllegalArgumentException - if a query has not been defined with the given name or if the query string is found to be invalid
        See Also:
        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).
        Parameters:
        name - the name of a query defined in metadata
        resultClass - the type of the query result
        Returns:
        The Query instance for manipulation and execution
        Throws:
        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
        See Also:
        EntityManager.createNamedQuery(String,Class)
      • createSQLQuery

        @Deprecated
        default SQLQuery createSQLQuery​(String queryString)
        Deprecated.
        (since 5.2) use createNativeQuery(String) instead
        Create a NativeQuery instance for the given SQL query string.
        Parameters:
        queryString - The SQL query
        Returns:
        The query instance for manipulation and execution
      • createNativeQuery

        NativeQuery createNativeQuery​(String sqlString)
        Create a NativeQuery instance for the given native (SQL) query
        Parameters:
        sqlString - a native SQL query string
        Returns:
        The NativeQuery instance for manipulation and execution
        See Also:
        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.
        Parameters:
        sqlString - Native (SQL) query string
        resultClass - The Java type to map results to
        Returns:
        The NativeQuery instance for manipulation and execution
        See Also:
        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.
        Parameters:
        sqlString - Native (SQL) query string
        resultSetMapping - The explicit (named) result mapping
        Returns:
        The NativeQuery instance for manipulation and execution
        See Also:
        EntityManager.createNativeQuery(String,Class), SqlResultSetMapping
      • getNamedSQLQuery

        @Deprecated
        default Query getNamedSQLQuery​(String name)
        Deprecated.
        (since 5.2) use getNamedNativeQuery(String) instead
        Get a NativeQuery instance for a named native SQL query
        Parameters:
        name - The name of the pre-defined query
        Returns:
        The NativeQuery instance for manipulation and execution
      • getNamedNativeQuery

        NativeQuery getNamedNativeQuery​(String name)
        Get a NativeQuery instance for a named native SQL query
        Parameters:
        name - The name of the pre-defined query
        Returns:
        The NativeQuery instance for manipulation and execution