Class JRHibernateQueryExecuterFactory
- java.lang.Object
-
- net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
-
- net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory
-
- All Implemented Interfaces:
JRQueryExecuterFactory,QueryExecuterFactory,Designated
public class JRHibernateQueryExecuterFactory extends AbstractQueryExecuterFactory implements Designated
Query executer factory for HQL queries that uses Hibernate 3. The factory createsJRHibernateQueryExecuterquery executers.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAMETER_HIBERNATE_FILTER_COLLECTIONBuilt-in parameter used for collection filter queries.static StringPARAMETER_HIBERNATE_SESSIONBuilt-in parameter holding the value of the Hibernate session to be used for creating the query.static StringPROPERTY_HIBERNATE_CLEAR_CACHEProperty specifying whether hibernate session cache should be cleared between two consecutive fetches when using pagination.static StringPROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONSProperty specifying whether field descriptions should be used to determine the mapping between the fields and the query return values.static StringPROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZEProperty specifying the number of result rows to be retrieved at once when the execution type is list.static StringPROPERTY_HIBERNATE_QUERY_RUN_TYPEProperty specifying the query execution type.static StringQUERY_EXECUTER_NAMEstatic StringQUERY_LANGUAGE_HQLHQL query language.static StringVALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATEValue of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to iterate execution type.static StringVALUE_HIBERNATE_QUERY_RUN_TYPE_LISTValue of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to list execution type.static StringVALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLLValue of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to scroll execution type.-
Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
QUERY_EXECUTER_FACTORY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description JRHibernateQueryExecuterFactory()
-
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 an array containing thePARAMETER_HIBERNATE_SESSIONandPARAMETER_HIBERNATE_FILTER_COLLECTIONparameters.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_HQL
public static final String QUERY_LANGUAGE_HQL
HQL query language.- See Also:
- Constant Field Values
-
PARAMETER_HIBERNATE_SESSION
public static final String PARAMETER_HIBERNATE_SESSION
Built-in parameter holding the value of the Hibernate session to be used for creating the query.- See Also:
- Constant Field Values
-
PARAMETER_HIBERNATE_FILTER_COLLECTION
public static final String PARAMETER_HIBERNATE_FILTER_COLLECTION
Built-in parameter used for collection filter queries. The value of this parameter will be used as the collection to filter using the query.- See Also:
- Constant Field Values
-
PROPERTY_HIBERNATE_QUERY_RUN_TYPE
public static final String PROPERTY_HIBERNATE_QUERY_RUN_TYPE
Property specifying the query execution type. Possible values are:- list (default) - the query will be run by calling
org.hibernate.Query.list() - iterate - the query will be run by calling
org.hibernate.Query.iterate() - scroll - the query will be run by calling
org.hibernate.Query.scroll()
- See Also:
- Constant Field Values
- list (default) - the query will be run by calling
-
PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE
public static final String PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE
Property specifying the number of result rows to be retrieved at once when the execution type is list. Result pagination is implemented byorg.hibernate.Query.setFirstResult()andorg.hibernate.Query.setMaxResults(). By default, all the rows are retrieved (no result pagination is performed).- See Also:
- Constant Field Values
-
PROPERTY_HIBERNATE_CLEAR_CACHE
public static final String PROPERTY_HIBERNATE_CLEAR_CACHE
Property specifying whether hibernate session cache should be cleared between two consecutive fetches when using pagination. By default, the cache cleanup is not performed.
-
PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS
public static final String PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS
Property specifying whether field descriptions should be used to determine the mapping between the fields and the query return values.- See Also:
- Constant Field Values
-
VALUE_HIBERNATE_QUERY_RUN_TYPE_LIST
public static final String VALUE_HIBERNATE_QUERY_RUN_TYPE_LIST
Value of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to list execution type.- See Also:
- Constant Field Values
-
VALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATE
public static final String VALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATE
Value of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to iterate execution type.- See Also:
- Constant Field Values
-
VALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLL
public static final String VALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLL
Value of thePROPERTY_HIBERNATE_QUERY_RUN_TYPEproperty corresponding to scroll execution type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBuiltinParameters
public Object[] getBuiltinParameters()
Returns an array containing thePARAMETER_HIBERNATE_SESSIONandPARAMETER_HIBERNATE_FILTER_COLLECTIONparameters.- 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
-
-