net.sf.jasperreports.engine.query
Class JRHibernateQueryExecuterFactory

java.lang.Object
  extended by net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
      extended by net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory
All Implemented Interfaces:
JRQueryExecuterFactory, QueryExecuterFactory

public class JRHibernateQueryExecuterFactory
extends AbstractQueryExecuterFactory

Query executer factory for HQL queries that uses Hibernate 3.

The factory creates JRHibernateQueryExecuter query executers.

Version:
$Id: JRHibernateQueryExecuterFactory.java 5305 2012-04-26 15:17:33Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Field Summary
static java.lang.String PARAMETER_HIBERNATE_FILTER_COLLECTION
          Built-in parameter used for collection filter queries.
static java.lang.String PARAMETER_HIBERNATE_SESSION
          Built-in parameter holding the value of the Hibernate session to be used for creating the query.
static java.lang.String PROPERTY_HIBERNATE_CLEAR_CACHE
          Property specifying whether hibernate session cache should be cleared between two consecutive fetches when using pagination.
static java.lang.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.
static java.lang.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.
static java.lang.String PROPERTY_HIBERNATE_QUERY_RUN_TYPE
          Property specifying the query execution type.
static java.lang.String QUERY_LANGUAGE_HQL
          HQL query language.
static java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATE
          Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to iterate execution type.
static java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_LIST
          Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to list execution type.
static java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLL
          Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to scroll execution type.
 
Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
QUERY_EXECUTER_FACTORY_PREFIX
 
Constructor Summary
JRHibernateQueryExecuterFactory()
           
 
Method Summary
 JRQueryExecuter createQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, java.util.Map<java.lang.String,? extends JRValueParameter> parameters)
          Creates a query executer.
 java.lang.Object[] getBuiltinParameters()
          Returns an array containing the PARAMETER_HIBERNATE_SESSION and PARAMETER_HIBERNATE_FILTER_COLLECTION parameters.
 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_HQL

public static final java.lang.String QUERY_LANGUAGE_HQL
HQL query language.

See Also:
Constant Field Values

PARAMETER_HIBERNATE_SESSION

public static final java.lang.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 java.lang.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 java.lang.String PROPERTY_HIBERNATE_QUERY_RUN_TYPE
Property specifying the query execution type.

Possible values are:

See Also:
Constant Field Values

PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE

public static final java.lang.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 by org.hibernate.Query.setFirstResult() and org.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 java.lang.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.

See Also:
PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE, Constant Field Values

PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS

public static final java.lang.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 java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_LIST
Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to list execution type.

See Also:
Constant Field Values

VALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATE

public static final java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_ITERATE
Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to iterate execution type.

See Also:
Constant Field Values

VALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLL

public static final java.lang.String VALUE_HIBERNATE_QUERY_RUN_TYPE_SCROLL
Value of the PROPERTY_HIBERNATE_QUERY_RUN_TYPE property corresponding to scroll execution type.

See Also:
Constant Field Values
Constructor Detail

JRHibernateQueryExecuterFactory

public JRHibernateQueryExecuterFactory()
Method Detail

getBuiltinParameters

public java.lang.Object[] getBuiltinParameters()
Returns an array containing the PARAMETER_HIBERNATE_SESSION and PARAMETER_HIBERNATE_FILTER_COLLECTION parameters.

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