net.sf.basedb.core
Class DataQuery<I extends BasicData>
java.lang.Object
net.sf.basedb.core.AbstractQuery
net.sf.basedb.core.AbstractHqlQuery
net.sf.basedb.core.AbstractEntityQuery
net.sf.basedb.core.DataQuery<I>
- All Implemented Interfaces:
- EntityQuery, HqlQuery, Query
public class DataQuery<I extends BasicData>
- extends AbstractEntityQuery
An implementation of the Query
interface that returns data
objects. This type of query is only used for batchable items,
like reporters and raw data.
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $
Field Summary |
private Class<I> |
dataClass
The class of the data objects that are returned. |
Constructor Summary |
DataQuery(Class<I> dataClass,
Item rootType,
String rootName,
String select)
Create a query that may have different return type and root entity. |
DataQuery(Class<I> dataClass,
String entityName)
Create a new query for the specified item, using the default optional
runtime filter. |
DataQuery(Class<I> dataClass,
String entityName,
QueryRuntimeFilter optionalFilter)
Create a new query for the specified item, using a non-default optional
runtime filter. |
Methods inherited from class net.sf.basedb.core.AbstractEntityQuery |
count, disableFilters, enableFilters, exclude, exclude, getItemPermission, getItemType, getQueryType, getRootType, group, groupPermanent, having, havingPermanent, include, include, isIncluded, isIncluded, select, selectPermanent, setAutoJoinType, setIncludes, setItemPermission |
Methods inherited from class net.sf.basedb.core.AbstractHqlQuery |
getCountHqlQuery, getMainHqlQuery, getRootAlias, isCachingResult, isReadonly, isStateless, postProcessQuery, reset, setCacheResult, setEntityParameter, setPermanentEntityParameter |
Methods inherited from class net.sf.basedb.core.AbstractQuery |
addAutoJoiner, getCountQuery, getFirstResult, getMainQuery, getMaxResults, getParameterNames, getParameters, getParameterType, getParameterValue, getPermanentSelects, getQueryParameter, getQuerySection, getSelects, hasParameterValue, isCounting, isDistinct, isReturningTotalCount, join, joinPermanent, order, orderPermanent, resetTemporary, restrict, restrictPermanent, setCounting, setDistinct, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, temporaryJoin, temporarySelect, toQl, toString |
Methods inherited from interface net.sf.basedb.core.query.Query |
addAutoJoiner, getFirstResult, getMaxResults, getParameterNames, getQueryParameter, getQuerySection, getRootAlias, hasParameterValue, isCounting, isDistinct, isReadonly, isReturningTotalCount, join, joinPermanent, order, orderPermanent, reset, restrict, restrictPermanent, setDistinct, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, toQl |
dataClass
private final Class<I extends BasicData> dataClass
- The class of the data objects that are returned.
DataQuery
DataQuery(Class<I> dataClass,
String entityName)
- Create a new query for the specified item, using the default optional
runtime filter.
- Parameters:
dataClass
- The class of the data objects that are returned
DataQuery
DataQuery(Class<I> dataClass,
Item rootType,
String rootName,
String select)
- Create a query that may have different return type and root entity.
For example, to return reporters from a query rooted at features:
new DataQuery(ReporterData.class, Item.FEATURE, null, "reporter")
.
This will be translated to something like (in HQL):
SELECT ftr.reporter FROM FeatureData ftr ...
- Parameters:
dataClass
- The class of the data objects that are returnedrootType
- The root item type of the queryrootName
- The root enitity name, or null to use
the class name of the root typeselect
- The HQL property that we should select on the root
type to get to the return type- Since:
- 2.8
DataQuery
DataQuery(Class<I> dataClass,
String entityName,
QueryRuntimeFilter optionalFilter)
- Create a new query for the specified item, using a non-default optional
runtime filter.
- Parameters:
dataClass
- The class of the data objects that are returnedoptionalFilter
- A runtime filter replacing the default optional filter
or null to not use any optional filter
iterate
public DataResultIterator<I> iterate(DbControl dc)
throws BaseException
- Execute the query and return the results as an iterator.
- Parameters:
dc
- The DbControl
used to access the database
and check permissions
- Throws:
BaseException
- If there is an error