net.sf.jasperreports.engine.query
public class JRHibernateQueryExecuter extends JRAbstractQueryExecuter
JRAbstractQueryExecuter.QueryParameter
CLAUSE_POSITION_ID, clauseFunctions, dataset
Constructor and Description |
---|
JRHibernateQueryExecuter(JRDataset dataset,
java.util.Map parameters) |
Modifier and Type | Method and Description |
---|---|
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.
|
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() . |
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) |
addQueryMultiParameters, addQueryParameter, appendClauseChunk, appendParameterChunk, appendParameterClauseChunk, appendQueryChunk, appendTextChunk, applyClause, checkParameter, getCollectedParameterNames, getCollectedParameters, getParameter, getParameterValue, getParameterValue, getQueryString, getValueParameter, getValueParameter, parseQuery, registerClauseFunction, resolveFunction, unregisterClauseFunction
public JRHibernateQueryExecuter(JRDataset dataset, java.util.Map parameters)
public JRDataSource createDatasource() throws JRException
JRHibernateListDataSource
,
JRHibernateIterateDataSource
or
JRHibernateScrollDataSource
, depending on theJRDataSource
wrapping the query execution result.JRException
protected JRDataSource createResultDatasource()
protected void createQuery(java.lang.String queryString)
PARAMETER_HIBERNATE_FILTER_COLLECTION
is not null, then a filter query is created using the value of the paramter as the collection.queryString
- the query stringprotected void setParameters()
protected void setParameter(JRValueParameter parameter)
parameter
- the report parameterpublic void close()
public void closeScrollableResults()
public boolean cancelQuery() throws JRException
JRQueryExecuter
true
if and only if the query was running and it has been canceledJRException
protected java.lang.String getParameterReplacement(java.lang.String parameterName)
JRAbstractQueryExecuter
getParameterReplacement
in class JRAbstractQueryExecuter
parameterName
- the paramter nameJRQueryChunk.TYPE_PARAMETER
protected java.lang.String getHqlParameterName(java.lang.String parameterName)
public Type[] getReturnTypes()
public java.lang.String[] getReturnAliases()
public JRDataset getDataset()
public java.util.List list()
org.hibernate.Query.list()
.
All the result rows are returned.protected void setQueryRunning(boolean queryRunning)
public java.util.List list(int firstIndex, int resultCount)
org.hibernate.Query.iterate()
.firstIndex
- the index of the first row to returnresultCount
- the number of rows to returnpublic java.util.Iterator iterate()
org.hibernate.Query.iterate()
.public ScrollableResults scroll()
org.hibernate.Query.scroll()
.public void clearCache()
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com