|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.DataQuery<I>
public class DataQuery<I extends BasicData>
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.
| Method Summary | |
|---|---|
int |
count(DbControl dc)
Count the number of items/rows that are returned by the query. |
void |
exclude(Include... excludes)
Specify options for which items to exclude from the result. |
int |
getFirstResult()
The number of the row the query should start returning. |
Item |
getItemType()
The type of items the query returns. |
int |
getMaxResults()
The maximum number of rows returned by the query. |
QueryType |
getQueryType()
Get the type of query. |
String |
getRootAlias()
The alias of the item that is returned by this query. |
void |
group(Expression expression)
Not supported. |
void |
groupPermanent(Expression expression)
Not supported. |
boolean |
hasParameterValue(String name)
Check if a value for the specified parameter has been set or not. |
void |
having(Restriction restriction)
Not supported. |
void |
havingPermanent(Restriction restriction)
Not supported. |
void |
include(Include... includes)
Specify options for which items to include in the result. |
boolean |
isCachingResult()
If the query results are cached or not. |
boolean |
isDistinct()
If this query returns distinct results of not. |
boolean |
isIncluded(Include... includes)
Check which options are set for the items to include in the result |
boolean |
isReadonly()
If this query is readonly and cannot be structurally modified. |
boolean |
isReturningTotalCount()
If this query returns the total count or not. |
DataResultIterator<I> |
iterate(DbControl dc)
Execute the query and return the results as an iterator. |
void |
join(Join join)
Add a join query element to the join list. |
void |
joinPermanent(Join join)
Permanently add a join query element to the join list. |
void |
order(Order order)
Add an ordering query element to the orderby list. |
void |
orderPermanent(Order order)
Permanently add an ordering query element to the orderby list. |
void |
reset()
Reset all non-permanent query elements of the query and clear cached queries. |
void |
restrict(Restriction restriction)
Add a restriction query element to the restriction list. |
void |
restrictPermanent(Restriction restriction)
Permanently add a restriction query element to the restriction list. |
void |
select(Select select)
Not supported. |
void |
selectPermanent(Select select)
Not supported. |
void |
setCacheResult(boolean flag)
Specify if the query results should be cached or not. |
void |
setDistinct(boolean flag)
Specify if the query should only return distinct rows. |
void |
setFirstResult(int firstResult)
Specify that the query should start returning rows from the specified row number. 0 = start returning from the first row. |
void |
setMaxResults(int maxResults)
Specify that the query should at most return the specified number of rows. |
void |
setParameter(String name,
Object value,
Type valueType)
Set the value of a query parameter. |
void |
setPermanentParameter(String name,
Object value,
Type valueType)
Permanently set the value of a query parameter. |
void |
setReturnTotalCount(boolean flag)
Specify if the query should return a count for the total number of items that would have been returned if the Query.setFirstResult(int)
and Query.setMaxResults(int) had been disabled, or if the results are
loaded by an iterator where the number of rows not are known beforehand. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.proteios.core.query.Query |
|---|
getFirstResult, getMaxResults, hasParameterValue, isDistinct, isReturningTotalCount, join, joinPermanent, order, orderPermanent, restrict, restrictPermanent, setDistinct, setFirstResult, setMaxResults, setParameter, setPermanentParameter, setReturnTotalCount |
| Method Detail |
|---|
public DataResultIterator<I> iterate(DbControl dc)
throws BaseException
dc - The DbControl used to access the database
and check permissions
BaseException - If there is an errorpublic void select(Select select)
select in interface Queryselect - The query element to add
UnsupportedOperationException - AlwaysQuery.selectPermanent(Select)public void selectPermanent(Select select)
selectPermanent in interface Queryselect - The query element to add
UnsupportedOperationException - AlwaysQuery.select(Select)public void group(Expression expression)
group in interface Queryexpression - The query element to add
UnsupportedOperationException - AlwaysQuery.groupPermanent(Expression)public void groupPermanent(Expression expression)
groupPermanent in interface Queryexpression - The query element to add
UnsupportedOperationException - AlwaysQuery.group(Expression)public void having(Restriction restriction)
having in interface Queryrestriction - The query element to add
UnsupportedOperationException - AlwaysQuery.havingPermanent(Restriction)public void havingPermanent(Restriction restriction)
havingPermanent in interface Queryrestriction - The query element to add
UnsupportedOperationException - AlwaysQuery.having(Restriction)public QueryType getQueryType()
Query
getQueryType in interface QueryQueryType.HQLpublic String getRootAlias()
getRootAlias in interface QueryItem.getAlias()public boolean isReadonly()
QueryQuery.reset() would unlock the query and allow it to be modified again.
isReadonly in interface Querypublic void reset()
reset in interface Query
public int count(DbControl dc)
throws BaseException
QueryQuery.getFirstResult() and Query.getMaxResults()
settings.
count in interface QueryBaseException - If there is an errorpublic void setCacheResult(boolean flag)
HqlQuery
setCacheResult in interface HqlQueryflag - TRUE if the query results should be cached, FALSE otherwisepublic boolean isCachingResult()
HqlQuery
isCachingResult in interface HqlQueryHqlQuery.setCacheResult(boolean)public Item getItemType()
EntityQuery
getItemType in interface EntityQuerypublic void include(Include... includes)
EntityQuery
include in interface EntityQueryincludes - An array of items that should be includedEntityQuery.exclude(Include[])public void exclude(Include... excludes)
EntityQuery
exclude in interface EntityQueryexcludes - An array of options that should be excludedEntityQuery.include(Include[])public boolean isIncluded(Include... includes)
EntityQuery
isIncluded in interface EntityQueryincludes - The options to check
public void join(Join join)
throws InvalidDataException,
BaseException
Query
join in interface Queryjoin - The query element to add
InvalidDataException
BaseExceptionQuery.joinPermanent(Join)
public void joinPermanent(Join join)
throws InvalidDataException,
BaseException
QueryQuery.reset() method.
joinPermanent in interface Queryjoin - The query element to add
InvalidDataException
BaseExceptionQuery.join(Join)
public void restrict(Restriction restriction)
throws InvalidDataException,
BaseException
Query
restrict in interface Queryrestriction - The query element to add
InvalidDataException
BaseExceptionQuery.restrictPermanent(Restriction)
public void restrictPermanent(Restriction restriction)
throws InvalidDataException,
BaseException
QueryQuery.reset() method.
restrictPermanent in interface Queryrestriction - The query element to add
InvalidDataException
BaseExceptionQuery.restrict(Restriction)
public void order(Order order)
throws InvalidDataException,
BaseException
Query
order in interface Queryorder - The query element to add
InvalidDataException
BaseExceptionQuery.orderPermanent(Order)
public void orderPermanent(Order order)
throws InvalidDataException,
BaseException
QueryQuery.reset() method.
orderPermanent in interface Queryorder - The query element to add
InvalidDataException
BaseExceptionQuery.order(Order)
public void setParameter(String name,
Object value,
Type valueType)
throws InvalidDataException,
BaseException
QueryQuery.setPermanentParameter(String, Object, Type)
method, an InvalidDataException is thrown.
setParameter in interface Queryname - The name of the parametervalue - The value of the parametervalueType - The type of the value, or null if not needed
InvalidDataException - If the value of the parameter has already
been permanently set
BaseExceptionQuery.setPermanentParameter(String, Object, Type)
public void setPermanentParameter(String name,
Object value,
Type valueType)
throws InvalidDataException,
BaseException
QueryInvalidDataException
is thrown.
setPermanentParameter in interface Queryname - The name of the parametervalue - The value of the parametervalueType - The type of the value, or null if not needed
InvalidDataException - If the value of the parameter has already
been permanently set
BaseExceptionQuery.setParameter(String, Object, Type)public boolean hasParameterValue(String name)
Query
hasParameterValue in interface Querypublic void setFirstResult(int firstResult)
QueryQuery.setMaxResults(int)
option.
setFirstResult in interface QueryfirstResult - The number of the first row starting at 0Query.setMaxResults(int)public int getFirstResult()
Query
getFirstResult in interface QueryQuery.setFirstResult(int)public void setMaxResults(int maxResults)
QueryQuery.setFirstResult(int)
option.
setMaxResults in interface QuerymaxResults - The maximum number of rows to returnQuery.setFirstResult(int)public int getMaxResults()
Query
getMaxResults in interface QueryQuery.setMaxResults(int)public void setReturnTotalCount(boolean flag)
QueryQuery.setFirstResult(int)
and Query.setMaxResults(int) had been disabled, or if the results are
loaded by an iterator where the number of rows not are known beforehand.
setReturnTotalCount in interface Queryflag - TRUE if the query should return the total count, FALSE otherwisepublic boolean isReturningTotalCount()
Query
isReturningTotalCount in interface QueryQuery.setReturnTotalCount(boolean)public void setDistinct(boolean flag)
Query
setDistinct in interface Queryflag - TRUE if the query should return distinct results, FALSE otherwisepublic boolean isDistinct()
Query
isDistinct in interface QueryQuery.setDistinct(boolean)
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||