net.sf.jasperreports.engine.query

## Class JRJpaQueryExecuterFactory

- java.lang.Object
- - net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
  - - net.sf.jasperreports.engine.query.JRJpaQueryExecuterFactory

- All Implemented Interfaces:
    JRQueryExecuterFactory, QueryExecuterFactory

      public class JRJpaQueryExecuterFactory
      extends AbstractQueryExecuterFactory

  Java Persistence API query executer factory for EJBQL queries.

  The factory creates `JRJpaQueryExecuter` query executers.
  Version:
    $Id: JRJpaQueryExecuterFactory.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Marcel Overdijk (marceloverdijk@hotmail.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PARAMETER_JPA_ENTITY_MANAGER` Built-in parameter holding the value of the `javax.persistence.EntityManager` to be used for creating the query.
    `static java.lang.String` | `PARAMETER_JPA_QUERY_HINTS_MAP` Built-in parameter (optional) holding the value of the query hints map.
    `static java.lang.String` | `PROPERTY_JPA_QUERY_HINT_PREFIX` Property specifying the prefix for EJBQL query hints.
    `static java.lang.String` | `PROPERTY_JPA_QUERY_PAGE_SIZE` Property specifying the number of result rows to be retrieved at once.
    `static java.lang.String` | `QUERY_LANGUAGE_EJBQL` EJBQL query language.

    - ### Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory

      `QUERY_EXECUTER_FACTORY_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRJpaQueryExecuterFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JRQueryExecuter` | `createQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, java.util.Map<java.lang.String,? extends JRValueParameter> parameters)` Creates a query executer.
    `java.lang.Object[]` | `getBuiltinParameters()` Returns the built-in parameters associated with this query type.
    `boolean` | `supportsQueryParameterType(java.lang.String className)` Returns `true` for all parameter types.

    - ### Methods inherited from class net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory

      `createQueryExecuter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### QUERY_LANGUAGE_EJBQL

          public static final java.lang.String QUERY_LANGUAGE_EJBQL

      EJBQL query language.
      See Also:
        Constant Field Values

    - #### PARAMETER_JPA_ENTITY_MANAGER

          public static final java.lang.String PARAMETER_JPA_ENTITY_MANAGER

      Built-in parameter holding the value of the `javax.persistence.EntityManager` to be used for creating the query.
      See Also:
        Constant Field Values

    - #### PARAMETER_JPA_QUERY_HINTS_MAP

          public static final java.lang.String PARAMETER_JPA_QUERY_HINTS_MAP

      Built-in parameter (optional) holding the value of the query hints map. Each named/value pair will be set as query hint against the query.
      See Also:
        Constant Field Values

    - #### PROPERTY_JPA_QUERY_PAGE_SIZE

          public static final java.lang.String PROPERTY_JPA_QUERY_PAGE_SIZE

      Property specifying the number of result rows to be retrieved at once.

      Result pagination is implemented by `javax.persistence.Query.setFirstResult()` and `javax.persistence.Query.setMaxResults()`.

      By default, all the rows are retrieved (no result pagination is performed).
      See Also:
        Constant Field Values

    - #### PROPERTY_JPA_QUERY_HINT_PREFIX

          public static final java.lang.String PROPERTY_JPA_QUERY_HINT_PREFIX

      Property specifying the prefix for EJBQL query hints.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JRJpaQueryExecuterFactory

          public JRJpaQueryExecuterFactory()

  - ### Method Detail

    - #### getBuiltinParameters

          public java.lang.Object[] getBuiltinParameters()

      Description copied from interface: `QueryExecuterFactory`
      Returns the built-in parameters associated with this query type.

      These parameters will be created as system-defined parameters for each report/dataset having a query of this type.

      The returned array should contain consecutive pairs of parameter names and parameter classes (e.g. `{"Param1", String.class, "Param2", "List.class"}`).
      Returns:
        array of built-in parameter names and types associated with this query type

    - #### createQueryExecuter

          public JRQueryExecuter createQueryExecuter(JasperReportsContext jasperReportsContext,
                                            JRDataset dataset,
                                            java.util.Map<java.lang.String,? extends JRValueParameter> parameters)
                                              throws JRException

      Description copied from interface: `QueryExecuterFactory`
      Creates a query executer.

      This method is called at fill time for reports/datasets having a query supported by this factory.
      Parameters:
        `jasperReportsContext` - the JasperReportsContext
        `dataset` - the dataset containing the query, fields, etc
        `parameters` - map of value parameters (instances of `JRValueParameter`) indexed by name
      Returns:
        a query executer
      Throws:
        `JRException`

    - #### supportsQueryParameterType

          public boolean supportsQueryParameterType(java.lang.String className)

      Returns `true` for all parameter types.
      Parameters:
        `className` - the value class name of the parameter
      Returns:
        whether the parameter value type is supported

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com