Package net.sf.basedb.core.query
Interface EntityQuery
- All Known Implementing Classes:
AbstractEntityQuery
,DataQuery
,ItemQuery
,ReporterScoreQuery
This a HQL query that return enitities, ie. items. The items may be returned
in the form of data classes (
DataQuery
) or
in the form of item classes (ItemQuery
).- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2015-05-12 09:25:48 +0200 (ti, 12 maj 2015) $
-
Method Summary
Modifier and TypeMethodDescriptionvoid
exclude
(Collection<Include> excludes) void
Specify options for which items to exclude from the result.The logged in user's permission on the items returned by this query.The type of items the query returns.The type of items that is the root of the query.Execute the query and return the ID values of all items matching the query.void
include
(Collection<Include> includes) void
Specify options for which items to include in the result.boolean
isIncluded
(Collection<Include> includes) boolean
isIncluded
(Include... includes) Check which options are set for the items to include in the resultvoid
setIncludes
(Collection<Include> includes) Clears the lists of includes and adds a new collection.void
setItemPermission
(Permission permission) Only return items which the logged in user has the specified permission for.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, count, getFirstResult, getMaxResults, getParameterNames, getQueryParameter, getQuerySection, getQueryType, getRootAlias, group, groupPermanent, hasParameterValue, having, havingPermanent, isCounting, isDistinct, isFailSafe, isReadonly, isReturningTotalCount, join, joinPermanent, order, orderPermanent, reset, restrict, restrictPermanent, select, selectPermanent, setDistinct, setFailSafe, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, toQl
-
Method Details
-
getItemType
Item getItemType()The type of items the query returns. -
getRootType
Item getRootType()The type of items that is the root of the query. In most cases, this is the same as thegetItemType()
, but not always.- Since:
- 2.8
-
include
Specify options for which items to include in the result.- Parameters:
includes
- An array of items that should be included- Throws:
UnsupportedOperationException
- If this operation isn't supported by the implementation- See Also:
-
include
- See Also:
-
setIncludes
Clears the lists of includes and adds a new collection.- Parameters:
includes
- The new includes to be hold in the list.- Since:
- 2.14.2
- See Also:
-
exclude
Specify options for which items to exclude from the result.- Parameters:
excludes
- An array of options that should be excluded- Throws:
UnsupportedOperationException
- If this operation isn't supported by the implementation- See Also:
-
exclude
- See Also:
-
isIncluded
Check which options are set for the items to include in the result- Parameters:
includes
- The options to check- Returns:
- TRUE If all specified options are included, FALSE otherwise
-
isIncluded
- See Also:
-
setItemPermission
Only return items which the logged in user has the specified permission for. The default is to return all items which the user has at least read permission for.- Parameters:
permission
- The required permission
-
getItemPermission
Permission getItemPermission()The logged in user's permission on the items returned by this query.- Returns:
- A Permission object
-
idList
Execute the query and return the ID values of all items matching the query.- Parameters:
dc
- TheDbControl
used to access the database and check permissions- Throws:
BaseException
- If there is an error- Since:
- 3.5
-