Package net.sf.basedb.core
Class DynamicReporterQuery
java.lang.Object
net.sf.basedb.core.AbstractQuery
net.sf.basedb.core.AbstractSqlQuery
net.sf.basedb.core.DynamicReporterQuery
- All Implemented Interfaces:
ClonableReporterQuery
,Query
,SqlQuery
Represents a query for reporter data in a "dynamic" way. The main difference
from a client applications point of view, is that it is possible to
specify which columns that should be selected. In a techinical point of
view the difference is that we are using SQL instead of HQl.
- Version:
- 2.4
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2017-12-08 14:18:12 +0100 (fr, 08 dec 2017) $
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Auto joiner for master reporter table.(package private) static class
Auto joiner for reporter lists.Nested classes/interfaces inherited from class net.sf.basedb.core.AbstractSqlQuery
AbstractSqlQuery.CountWork
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new dynamic query for reporter data.Create a new dynamic query for reporter data using cloned reporter information. -
Method Summary
Modifier and TypeMethodDescription(package private) Select[]
No default selection.getJepFunctions
(DbControl dc, boolean restrictions) The following JEP functions can be used: rep(property):ReporterFunction
mrep(property):ReporterFunction
(only for cloned reporters) inList(reporter-list-id):InReporterListFunction
(only if restrictions=true) notInList(reporter-list-id):NotInReporterListFunction
(only if restrictions=true)getMasterReporterJoiner
(JoinType joinType) Get a joiner instance for joining the master reporter table when the root query is against the cloned reporters table.getReporterListJoiner
(JoinType joinType) Get a joiner instance for reporter lists for the specified join type.The alias of the item that is returned by this query.Get the virtual database that this query is using.boolean
Check if the virtual database that this query is using has cloned reporter annotations or not.boolean
If this query is readonly and cannot be structurally modified.void
joinMasterReporters
(JoinType joinType) Join the master reporter table into this query.void
joinReporterList
(ReporterList reporterList, JoinType joinType) Makes a join with aReporterList
void
setAutoJoinType
(JoinType joinType) Specify the join type of automatic joins.void
setUseClonedReporters
(boolean useClonedReporters) Set if cloned reporters should be used by default or not.boolean
Checks if this query is using cloned reporter or not by default.Methods inherited from class net.sf.basedb.core.AbstractSqlQuery
closeResultSet, closeStatement, count, getLimitHandler, getQueryType, getRowSelectionForLimitHandler, iterate, parseParameters, releaseSavepoint, rollbackToSavepoint, setParameters
Methods inherited from class net.sf.basedb.core.AbstractQuery
addAutoJoiner, getCountQuery, getFirstResult, getIdQuery, getMainQuery, getMaxResults, getParameterNames, getParameters, getParameterType, getParameterValue, getPermanentSelects, getQueryParameter, getQuerySection, getSelects, group, groupPermanent, hasParameterValue, having, havingPermanent, isCounting, isDistinct, isFailSafe, isReturningTotalCount, join, joinPermanent, order, orderPermanent, postProcessQuery, reset, resetTemporary, restrict, restrictPermanent, select, selectPermanent, 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.Query
addAutoJoiner, getFirstResult, getMaxResults, getParameterNames, getQueryParameter, getQuerySection, group, groupPermanent, hasParameterValue, having, havingPermanent, isCounting, isDistinct, isFailSafe, isReturningTotalCount, join, joinPermanent, order, orderPermanent, reset, restrict, restrictPermanent, select, selectPermanent, setDistinct, setFailSafe, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, toQl
-
Field Details
-
rootAlias
-
virtualDb
-
hasClonedReporters
private final boolean hasClonedReporters -
useClonedReporters
private boolean useClonedReporters -
joinedItems
-
-
Constructor Details
-
DynamicReporterQuery
DynamicReporterQuery()Create a new dynamic query for reporter data. -
DynamicReporterQuery
DynamicReporterQuery(VirtualDb vdb) Create a new dynamic query for reporter data using cloned reporter information.- Since:
- 3.1
-
-
Method Details
-
getRootAlias
The alias of the item that is returned by this query.- Specified by:
getRootAlias
in interfaceQuery
- See Also:
-
isReadonly
public boolean isReadonly()Description copied from interface:Query
If this query is readonly and cannot be structurally modified. Ie. no more query elements can be added. It is still possible to set parameter values. A call toQuery.reset()
would unlock the query and allow it to be modified again.- Specified by:
isReadonly
in interfaceQuery
- Overrides:
isReadonly
in classAbstractQuery
- Returns:
- TRUE if the query is readonly, FALSE otherwise
-
getDefaultSelects
Select[] getDefaultSelects()No default selection.- Specified by:
getDefaultSelects
in classAbstractSqlQuery
-
getJepFunctions
The following JEP functions can be used:- rep(property):
ReporterFunction
- mrep(property):
ReporterFunction
(only for cloned reporters) - inList(reporter-list-id):
InReporterListFunction
(only if restrictions=true) - notInList(reporter-list-id):
NotInReporterListFunction
(only if restrictions=true)
- Specified by:
getJepFunctions
in classAbstractSqlQuery
restrictions
- If FALSE the metod should only return functions that can be used asExpression
:s, otherwise it should return both expression and restriction functions- Since:
- 3.12
- rep(property):
-
hasClonedReporters
public boolean hasClonedReporters()Check if the virtual database that this query is using has cloned reporter annotations or not.- Specified by:
hasClonedReporters
in interfaceClonableReporterQuery
- Since:
- 3.1
-
useClonedReporters
public boolean useClonedReporters()Checks if this query is using cloned reporter or not by default. The default setting is to use cloned reporters if they are available in the experiment.- Specified by:
useClonedReporters
in interfaceClonableReporterQuery
- Returns:
- TRUE if this query is using cloned reporters, FALSE if not
- Since:
- 3.1
-
setUseClonedReporters
public void setUseClonedReporters(boolean useClonedReporters) Set if cloned reporters should be used by default or not.- Specified by:
setUseClonedReporters
in interfaceClonableReporterQuery
- Parameters:
useClonedReporters
- TRUE to use cloned reporters by default, FALSE to use the master reporters- Since:
- 3.1
-
getVirtualDb
Get the virtual database that this query is using.- Specified by:
getVirtualDb
in interfaceClonableReporterQuery
- Returns:
- A virtual database item (can be null if hasClonedReporter is false)
- Since:
- 3.1
-
joinReporterList
Makes a join with aReporterList
- Parameters:
reporterList
- To do the join on.joinType
- The join type to use.- Since:
- 3.0
- See Also:
-
joinMasterReporters
Join the master reporter table into this query. This is ignored unless the query rooted at the cloned reporters table.- Parameters:
joinType
- The join type to use- Since:
- 3.1
-
setAutoJoinType
Specify the join type of automatic joins. The default join type isJoinType.LEFT
. This setting doesn't affect joins that has been made directly to the query.- Parameters:
joinType
- The type of the automatic joins- Since:
- 3.0
-
getReporterListJoiner
Get a joiner instance for reporter lists for the specified join type.- Parameters:
joinType
- The type of join- Since:
- 3.0
-
getMasterReporterJoiner
Get a joiner instance for joining the master reporter table when the root query is against the cloned reporters table.- Parameters:
joinType
- The type of join- Since:
- 3.1
-