Class JRJpaQueryExecuterFactory
java.lang.Object
net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
net.sf.jasperreports.engine.query.JRJpaQueryExecuterFactory
- All Implemented Interfaces:
JRQueryExecuterFactory,QueryExecuterFactory,Designated
Java Persistence API query executer factory for EJBQL queries.
The factory creates
JRJpaQueryExecuter
query executers.- Author:
- Marcel Overdijk (marceloverdijk@hotmail.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBuilt-in parameter holding the value of thejavax.persistence.EntityManagerto be used for creating the query.static final StringBuilt-in parameter (optional) holding the value of the query hints map.static final StringProperty specifying the prefix for EJBQL query hints.static final StringProperty specifying the number of result rows to be retrieved at once.static final Stringstatic final StringEJBQL query language.Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
QUERY_EXECUTER_FACTORY_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String, ? extends JRValueParameter> parameters) Creates a query executer.Object[]Returns the built-in parameters associated with this query type.booleansupportsQueryParameterType(String className) Returnstruefor all parameter types.Methods inherited from class net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
createQueryExecuterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
createQueryExecuter
-
Field Details
-
QUERY_EXECUTER_NAME
- See Also:
-
QUERY_LANGUAGE_EJBQL
EJBQL query language.- See Also:
-
PARAMETER_JPA_ENTITY_MANAGER
Built-in parameter holding the value of thejavax.persistence.EntityManagerto be used for creating the query.- See Also:
-
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:
-
PROPERTY_JPA_QUERY_PAGE_SIZE
Property specifying the number of result rows to be retrieved at once. Result pagination is implemented byjavax.persistence.Query.setFirstResult()andjavax.persistence.Query.setMaxResults(). By default, all the rows are retrieved (no result pagination is performed).- See Also:
-
PROPERTY_JPA_QUERY_HINT_PREFIX
Property specifying the prefix for EJBQL query hints.- See Also:
-
-
Constructor Details
-
JRJpaQueryExecuterFactory
public JRJpaQueryExecuterFactory()
-
-
Method Details
-
getBuiltinParameters
Description copied from interface:QueryExecuterFactoryReturns 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"}).- Specified by:
getBuiltinParametersin interfaceJRQueryExecuterFactory- Specified by:
getBuiltinParametersin interfaceQueryExecuterFactory- Returns:
- array of built-in parameter names and types associated with this query type
-
createQueryExecuter
public JRQueryExecuter createQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String, ? extends JRValueParameter> parameters) throws JRExceptionDescription copied from interface:QueryExecuterFactoryCreates a query executer. This method is called at fill time for reports/datasets having a query supported by this factory.- Specified by:
createQueryExecuterin interfaceQueryExecuterFactory- Parameters:
jasperReportsContext- the JasperReportsContextdataset- the dataset containing the query, fields, etcparameters- map of value parameters (instances ofJRValueParameter) indexed by name- Returns:
- a query executer
- Throws:
JRException
-
supportsQueryParameterType
Returnstruefor all parameter types.- Specified by:
supportsQueryParameterTypein interfaceJRQueryExecuterFactory- Specified by:
supportsQueryParameterTypein interfaceQueryExecuterFactory- Parameters:
className- the value class name of the parameter- Returns:
- whether the parameter value type is supported
-
getDesignation
- Specified by:
getDesignationin interfaceDesignated
-