Package net.sf.basedb.core
Class ItemQuery<I extends BasicItem>
- java.lang.Object
-
- net.sf.basedb.core.AbstractQuery
-
- net.sf.basedb.core.AbstractHqlQuery
-
- net.sf.basedb.core.AbstractEntityQuery
-
- net.sf.basedb.core.ItemQuery<I>
-
- All Implemented Interfaces:
EntityQuery
,HqlQuery
,Query
public class ItemQuery<I extends BasicItem> extends AbstractEntityQuery
An implementation of theQuery
interface that returns item objects. This type of query is used for all items except those that are batchable, for example reporters and raw data. The result of a query can be returned as a list or an iterator.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
-
Constructor Summary
Constructors Constructor Description ItemQuery(Class<I> itemClass)
Create a new query for the specified item, using the default optional runtime filter.ItemQuery(Class<I> itemClass, QueryRuntimeFilter optionalFilter)
Create a new query for the specified item, using a non-default optional runtime filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemResultIterator<I>
iterate(DbControl dc)
Execute the query and return the results as an iterator.ItemResultList<I>
list(DbControl dc)
Execute the query and return the results as a list.-
Methods inherited from class net.sf.basedb.core.AbstractEntityQuery
count, disableFilters, enableFilters, exclude, exclude, getItemPermission, getItemType, getQueryType, getRootType, group, groupPermanent, having, havingPermanent, idList, include, include, isIncluded, isIncluded, select, selectPermanent, setAutoJoinType, setIncludes, setItemPermission
-
Methods inherited from class net.sf.basedb.core.AbstractHqlQuery
getCountHqlQuery, getIdHqlQuery, getMainHqlQuery, getRootAlias, isCachingResult, isReadonly, isStateless, postProcessQuery, reset, setCacheResult, setEntityParameter, setPermanentEntityParameter
-
Methods inherited from class net.sf.basedb.core.AbstractQuery
addAutoJoiner, getCountQuery, getFirstResult, getIdQuery, getMainQuery, getMaxResults, getParameterNames, getParameters, getParameterType, getParameterValue, getPermanentSelects, getQueryParameter, getQuerySection, getSelects, hasParameterValue, isCounting, isDistinct, isFailSafe, isReturningTotalCount, join, joinPermanent, order, orderPermanent, resetTemporary, restrict, restrictPermanent, setCounting, setDistinct, setFailSafe, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, temporaryJoin, temporarySelect, toQl, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.query.HqlQuery
isCachingResult, setCacheResult, setEntityParameter, setPermanentEntityParameter
-
Methods inherited from interface net.sf.basedb.core.query.Query
addAutoJoiner, getFirstResult, getMaxResults, getParameterNames, getQueryParameter, getQuerySection, getRootAlias, hasParameterValue, isCounting, isDistinct, isFailSafe, isReadonly, isReturningTotalCount, join, joinPermanent, order, orderPermanent, reset, restrict, restrictPermanent, setDistinct, setFailSafe, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, toQl
-
-
-
-
Constructor Detail
-
ItemQuery
ItemQuery(Class<I> itemClass)
Create a new query for the specified item, using the default optional runtime filter.- Parameters:
itemClass
- The class of the item objects that are returned
-
ItemQuery
ItemQuery(Class<I> itemClass, QueryRuntimeFilter optionalFilter)
Create a new query for the specified item, using a non-default optional runtime filter.- Parameters:
itemClass
- The class of the item objects that are returnedoptionalFilter
- A runtime filter replacing the default optional filter or null to not use any optional filter
-
-
Method Detail
-
list
public ItemResultList<I> list(DbControl dc) throws BaseException
Execute the query and return the results as a list.- Parameters:
dc
- TheDbControl
used to access the database and check permissions- Throws:
BaseException
- If there is an error
-
iterate
public ItemResultIterator<I> iterate(DbControl dc) throws BaseException
Execute the query and return the results as an iterator.- Parameters:
dc
- TheDbControl
used to access the database and check permissions- Throws:
BaseException
- If there is an error
-
-