Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.jasperreports.engine.query
Class JRHibernateQueryExecuter

    java.lang.Object
      net.sf.jasperreports.engine.query.JRAbstractQueryExecuter
          net.sf.jasperreports.engine.query.JRHibernateQueryExecuter

All Implemented Interfaces:
  JRQueryExecuter

    public class JRHibernateQueryExecuter

extends JRAbstractQueryExecuter

HQL query executer that uses Hibernate 3.

Version:
  $Id: JRHibernateQueryExecuter.java 3689 2010-04-06 11:33:27Z shertage $
Author:
  Lucian Chirita (lucianc@users.sourceforge.net)

Nested Class Summary

Nested classes/interfaces inherited from class net.sf.jasperreports.engine.query.JRAbstractQueryExecuter
`JRAbstractQueryExecuter.QueryParameter`

Field Summary

Fields inherited from class net.sf.jasperreports.engine.query.JRAbstractQueryExecuter
`CLAUSE_POSITION_ID, clauseFunctions, dataset`

Constructor Summary
`JRHibernateQueryExecuter(JRDataset dataset, java.util.Map parameters)`

Method Summary
`boolean` | `cancelQuery()` Cancels the query if it's currently running.
`void` | `clearCache()`
`void` | `close()` Closes the scrollable result when scroll execution type is used.
`void` | `closeScrollableResults()` Closes the scrollable results of the query.
`JRDataSource` | `createDatasource()` Creates an instance of `JRHibernateListDataSource`, `JRHibernateIterateDataSource` or `JRHibernateScrollDataSource`, depending on the
`protected void` | `createQuery(java.lang.String queryString)` Creates the Hibernate query object.
`protected JRDataSource` | `createResultDatasource()` Creates a data source out of the query result.
`JRDataset` | `getDataset()` Returns the dataset for which the query executer has been created.
`protected java.lang.String` | `getHqlParameterName(java.lang.String parameterName)`
`protected java.lang.String` | `getParameterReplacement(java.lang.String parameterName)` Returns the replacement text for a query paramter.
`java.lang.String[]` | `getReturnAliases()` Returns the aliases of the HQL query.
`org.hibernate.type.Type[]` | `getReturnTypes()` Returns the return types of the HQL query.
`java.util.Iterator` | `iterate()` Runs the query by calling `org.hibernate.Query.iterate()`.
`java.util.List` | `list()` Runs the query by calling `org.hibernate.Query.list()`.
`java.util.List` | `list(int firstIndex, int resultCount)` Returns a page of the query results by calling `org.hibernate.Query.iterate()`.
`org.hibernate.ScrollableResults` | `scroll()` Runs the query by calling `org.hibernate.Query.scroll()`.
`protected void` | `setParameter(JRValueParameter parameter)` Binds a paramter value to a query paramter.
`protected void` | `setParameters()` Binds values for all the query paramters.
`protected void` | `setQueryRunning(boolean queryRunning)`

Methods inherited from class net.sf.jasperreports.engine.query.JRAbstractQueryExecuter
`addQueryMultiParameters, addQueryParameter, appendClauseChunk, appendParameterChunk, appendParameterClauseChunk, appendQueryChunk, appendTextChunk, applyClause, checkParameter, getCollectedParameterNames, getCollectedParameters, getParameter, getParameterValue, getParameterValue, getQueryString, getValueParameter, getValueParameter, parseQuery, registerClauseFunction, resolveFunction, unregisterClauseFunction`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JRHibernateQueryExecuter

    public JRHibernateQueryExecuter(JRDataset dataset,
                                    java.util.Map parameters)

Method Detail

### createDatasource

    public JRDataSource createDatasource()
                                  throws JRException

  Creates an instance of `JRHibernateListDataSource`, `JRHibernateIterateDataSource` or `JRHibernateScrollDataSource`, depending on the

  Returns:
    a `JRDataSource` wrapping the query execution result.
  Throws:
    `JRException`

### createResultDatasource

    protected JRDataSource createResultDatasource()

  Creates a data source out of the query result.

  Returns:
    the data source

### createQuery

    protected void createQuery(java.lang.String queryString)

  Creates the Hibernate query object.

  If the value of the `PARAMETER_HIBERNATE_FILTER_COLLECTION` is not null, then a filter query is created using the value of the paramter as the collection.

  Parameters:
    `queryString` - the query string

### setParameters

    protected void setParameters()

  Binds values for all the query paramters.

### setParameter

    protected void setParameter(JRValueParameter parameter)

  Binds a paramter value to a query paramter.

  Parameters:
    `parameter` - the report parameter

### close

    public void close()

  Closes the scrollable result when scroll execution type is used.

### closeScrollableResults

    public void closeScrollableResults()

  Closes the scrollable results of the query.

### cancelQuery

    public boolean cancelQuery()
                        throws JRException

  Description copied from interface: `JRQueryExecuter`
  Cancels the query if it's currently running.

  This method will be called from a different thread if the client decides to cancel the filling process.

  Returns:
    `true` if and only if the query was running and it has been canceled
  Throws:
    `JRException`

### getParameterReplacement

    protected java.lang.String getParameterReplacement(java.lang.String parameterName)

  Description copied from class: `JRAbstractQueryExecuter`
  Returns the replacement text for a query paramter.

  Specified by:
    `getParameterReplacement` in class `JRAbstractQueryExecuter`
  Parameters:
    `parameterName` - the paramter name
  Returns:
    the replacement text
  See Also:
    `JRQueryChunk.TYPE_PARAMETER`

### getHqlParameterName

    protected java.lang.String getHqlParameterName(java.lang.String parameterName)

### getReturnTypes

    public org.hibernate.type.Type[] getReturnTypes()

  Returns the return types of the HQL query.

  Returns:
    the return types of the HQL query

### getReturnAliases

    public java.lang.String[] getReturnAliases()

  Returns the aliases of the HQL query.

  Returns:
    the aliases of the HQL query

### getDataset

    public JRDataset getDataset()

  Returns the dataset for which the query executer has been created.

  Returns:
    the dataset for which the query executer has been created

### list

    public java.util.List list()

  Runs the query by calling `org.hibernate.Query.list()`.

  All the result rows are returned.

  Returns:
    the result of the query as a list

### setQueryRunning

    protected void setQueryRunning(boolean queryRunning)

### list

    public java.util.List list(int firstIndex,
                               int resultCount)

  Returns a page of the query results by calling `org.hibernate.Query.iterate()`.

  Parameters:
    `firstIndex` - the index of the first row to return
    `resultCount` - the number of rows to return
  Returns:
    result row list

### iterate

    public java.util.Iterator iterate()

  Runs the query by calling `org.hibernate.Query.iterate()`.

  Returns:
    query iterator

### scroll

    public org.hibernate.ScrollableResults scroll()

  Runs the query by calling `org.hibernate.Query.scroll()`.

  Returns:
    scrollable results of the query

### clearCache

    public void clearCache()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com