Package net.sf.basedb.core
Class DynamicSpotQuery
java.lang.Object
net.sf.basedb.core.AbstractQuery
net.sf.basedb.core.AbstractSqlQuery
net.sf.basedb.core.DynamicQuery
net.sf.basedb.core.DynamicSpotQuery
- All Implemented Interfaces:
ClonableReporterQuery
,Query
,SqlQuery
Represents a query for spot information in the dynamic database. A single
query object may query against data in one bioassayset at a time.
Use factory methods in the
Dynamic
class to join other tables and
create restrictions based on the data in those tables. You may of course
also use the regular expressions and restrictions from the Expressions
, Restrictions
and other classes.
This type of query is executed by the AbstractSqlQuery.iterate(DbControl)
method
and returns the result as a DynamicResultIterator
.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2014-06-04 14:41:12 +0200 (on, 04 jun 2014) $
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.basedb.core.AbstractSqlQuery
AbstractSqlQuery.CountWork
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) Select[]
Default selection: column, postion, ch1, ch2, ...boolean
getJepFunctions
(DbControl dc, boolean restrictions) The following JEP functions can be used: ch(n):ChannelFunction
rawCh(n):RawChannelFunction
pos():PositionFunction
rep(property):ReporterFunction
score(reporter-list-id):ScoreFunction
xtra(extra-value-id):ExtraValueFunction
(if a bioassay set has been specified) raw(property):RawFunction
inList(reporter-list-id):InReporterListFunction
(only if restrictions=true) notInList(reporter-list-id):NotInReporterListFunction
(only if restrictions=true)boolean
Check if joining to raw data has been disabled.void
joinExtraValue
(ExtraValue extraValue, JoinType joinType) Join extra values in the query.void
joinRawData
(JoinType joinType) Join information about raw data in the query.void
joinReporterList
(ReporterList reporterList, JoinType joinType) Makes a join with aReporterList
void
joinReporters
(JoinType joinType) Join information about reporters in the query.void
joinReporters
(JoinType joinType, boolean useCloned) Join information about reporters in the query.void
reset()
Reset join information.void
setAutoJoinType
(JoinType joinType) Specify the join type of automatic joins.void
setDisableRawJoinOnMergedData
(boolean disable) Disable automatic and manual joining of raw data if the bioassay set contains merged data.Methods inherited from class net.sf.basedb.core.DynamicQuery
getDataCube, getIntensityTransform, getRootAlias, getRootTable, getVirtualDb, hasClonedReporters, setUseClonedReporters, useClonedReporters
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, isReadonly, isReturningTotalCount, join, joinPermanent, order, orderPermanent, postProcessQuery, 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, isReadonly, isReturningTotalCount, join, joinPermanent, order, orderPermanent, restrict, restrictPermanent, select, selectPermanent, setDistinct, setFailSafe, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount, toQl
-
Field Details
-
bioAssaySet
-
disableRawJoinOnMergedData
private boolean disableRawJoinOnMergedData -
defaultSelects
-
joinedItems
-
-
Constructor Details
-
DynamicSpotQuery
DynamicSpotQuery(BioAssaySet bioAssaySet) Create a new dynamic query.- Parameters:
bioAssaySet
- The bioassay set to query against
-
-
Method Details
-
getDefaultSelects
Select[] getDefaultSelects()Default selection: column, postion, ch1, ch2, ...- Specified by:
getDefaultSelects
in classAbstractSqlQuery
-
reset
public void reset()Reset join information.- Specified by:
reset
in interfaceQuery
- Overrides:
reset
in classAbstractQuery
-
getJepFunctions
The following JEP functions can be used:- ch(n):
ChannelFunction
- rawCh(n):
RawChannelFunction
- pos():
PositionFunction
- rep(property):
ReporterFunction
- score(reporter-list-id):
ScoreFunction
- xtra(extra-value-id):
ExtraValueFunction
(if a bioassay set has been specified) - raw(property):
RawFunction
- 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:
- 2.15
- ch(n):
-
setDisableRawJoinOnMergedData
public void setDisableRawJoinOnMergedData(boolean disable) Disable automatic and manual joining of raw data if the bioassay set contains merged data. Eg. if theBioAssaySet.getMaxRawMappingsForSpot()
returns a value != 1. Note! Joins that have already been applied before this method is called are not disabled.- Since:
- 2.15
-
getDisableRawJoinOnMergedData
public boolean getDisableRawJoinOnMergedData()- Returns:
- TRUE if joining raw data has been disabled for merged data
-
hasDisabledRawJoin
public boolean hasDisabledRawJoin()Check if joining to raw data has been disabled. It is disabled only ifBioAssaySet.getMaxRawMappingsForSpot()
!= 1 andgetDisableRawJoinOnMergedData()
== true- Returns:
- TRUE if raw data join has been disabled, FALSE if not
-
joinReporters
Join information about reporters in the query. Now it becomes possible to select reporter data or restrict the results based on reporter information.NOTE! Since BASE 3.1 this method automatically join to the cloned reporter table if available. Use
joinReporters(JoinType, boolean)
, orDynamicQuery.setUseClonedReporters(boolean)
with a FALSE value to force using the master reporters table.- Parameters:
joinType
- The type of join. Can not be null.- Throws:
InvalidDataException
- If joinType parameter is null.- See Also:
-
joinReporters
Join information about reporters in the query. If the useCloned parameter is TRUE cloned reporter annotations are used if available, otherwise the master reporter annotations are used.- Parameters:
joinType
- The type of join. Can not be null.- Throws:
InvalidDataException
- If joinType parameter is null.- Since:
- 3.1
- See Also:
-
joinReporterList
Makes a join with aReporterList
- Parameters:
reporterList
- To do the join on.joinType
- The join type to use.- See Also:
-
joinRawData
Join information about raw data in the query. Now it becomes possible to select raw data or restrict the results based on values in the raw data.- Parameters:
joinType
- The type of join. Can not be null.- Throws:
InvalidDataException
- If joinType parameter is null.- See Also:
-
joinExtraValue
Join extra values in the query. Now it becomes possible to select those extra values or use them for restrictions.- Parameters:
extraValue
- The extra values to join. Can not be null.joinType
- The type of join. Can not be null.- Throws:
InvalidDataException
- If any of the required parameters are null.- See Also:
-
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
-