Class JRJpaQueryExecuterFactory
- java.lang.Object
-
- net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
-
- net.sf.jasperreports.engine.query.JRJpaQueryExecuterFactory
-
- All Implemented Interfaces:
JRQueryExecuterFactory,QueryExecuterFactory,Designated
public class JRJpaQueryExecuterFactory extends AbstractQueryExecuterFactory implements Designated
Java Persistence API query executer factory for EJBQL queries. The factory createsJRJpaQueryExecuterquery executers.- Author:
- Marcel Overdijk (marceloverdijk@hotmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAMETER_JPA_ENTITY_MANAGERBuilt-in parameter holding the value of thejavax.persistence.EntityManagerto be used for creating the query.static StringPARAMETER_JPA_QUERY_HINTS_MAPBuilt-in parameter (optional) holding the value of the query hints map.static StringPROPERTY_JPA_QUERY_HINT_PREFIXProperty specifying the prefix for EJBQL query hints.static StringPROPERTY_JPA_QUERY_PAGE_SIZEProperty specifying the number of result rows to be retrieved at once.static StringQUERY_EXECUTER_NAMEstatic StringQUERY_LANGUAGE_EJBQLEJBQL query language.-
Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
QUERY_EXECUTER_FACTORY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description JRJpaQueryExecuterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JRQueryExecutercreateQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String,? extends JRValueParameter> parameters)Creates a query executer.Object[]getBuiltinParameters()Returns the built-in parameters associated with this query type.StringgetDesignation()booleansupportsQueryParameterType(String className)Returnstruefor 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
-
Methods inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
createQueryExecuter
-
-
-
-
Field Detail
-
QUERY_EXECUTER_NAME
public static final String QUERY_EXECUTER_NAME
- See Also:
- Constant Field Values
-
QUERY_LANGUAGE_EJBQL
public static final String QUERY_LANGUAGE_EJBQL
EJBQL query language.- See Also:
- Constant Field Values
-
PARAMETER_JPA_ENTITY_MANAGER
public static final String PARAMETER_JPA_ENTITY_MANAGER
Built-in parameter holding the value of thejavax.persistence.EntityManagerto be used for creating the query.- See Also:
- Constant Field Values
-
PARAMETER_JPA_QUERY_HINTS_MAP
public static final 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 String 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:
- Constant Field Values
-
PROPERTY_JPA_QUERY_HINT_PREFIX
public static final String PROPERTY_JPA_QUERY_HINT_PREFIX
Property specifying the prefix for EJBQL query hints.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBuiltinParameters
public Object[] 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 JRException
Description 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
public boolean supportsQueryParameterType(String className)
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
public String getDesignation()
- Specified by:
getDesignationin interfaceDesignated
-
-