|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.webapp.query.QRestrictor<T>
to.etc.webapp.query.QCriteriaQueryBase<T>
to.etc.webapp.query.QSelection<T>
public class QSelection<T>
Represents a selection of data elements from a database. This differs from a QCriteria in that it collects not one persistent class instance per row but multiple items per row, and each item can either be a persistent class or some property or calculated value (max, min, count et al).
Even though this type has a generic type parameter representing the base object being queried, the list() method for this object will return a List
QSelection queries return an array of items for each row, and each element of the array is typed depending on it's source. In addition, QSelection queries expose the ability to handle grouping. QSelection criteria behave as and should be seen as SQL queries in an OO wrapping.
Method Summary | ||
---|---|---|
QSelection<T> |
add(QOperatorNode r)
|
|
QSelection<T> |
add(QOrder r)
Add an order clause to the list of sort items. |
|
void |
addColumn(QSelectionItem item,
java.lang.String alias)
Add a column selector to the selection list. |
|
void |
addPropertySelection(QSelectionFunction f,
java.lang.String prop,
java.lang.String alias)
Add a simple property selector to the list. |
|
QSelection<T> |
ascending(java.lang.String property)
Add a property to do an ascending sort on. |
|
QSelection<T> |
avg(java.lang.String property)
Select the average value of a property in the set. |
|
QSelection<T> |
avg(java.lang.String property,
java.lang.String alias)
Select the average value of a property in the set. |
|
QSelection<T> |
between(java.lang.String property,
java.lang.Object a,
java.lang.Object b)
Compare the value of a property with two literal bounds. |
|
QSelection<T> |
count(java.lang.String property)
Select a count over the result set. |
|
QSelection<T> |
count(java.lang.String property,
java.lang.String alias)
Select a count over the result set. |
|
QSelection<T> |
countDistinct(java.lang.String property)
Select a count of the distinct values over the result set. |
|
QSelection<T> |
countDistinct(java.lang.String property,
java.lang.String alias)
Select a count of the distinct values over the result set. |
|
static
|
create(java.lang.Class<T> root)
Create a selection query based on the specified persistent class (public API). |
|
QSelection<T> |
descending(java.lang.String property)
Add a property to do a descending sort on. |
|
QSelection<T> |
distinct(java.lang.String property)
Select of the distinct values over the result set. |
|
QSelection<T> |
distinct(java.lang.String property,
java.lang.String alias)
Select of the distinct values over the result set. |
|
QSelection<T> |
eq(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
eq(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
eq(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
ge(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
ge(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
ge(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
gt(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
gt(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
gt(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
ilike(java.lang.String property,
java.lang.Object value)
Do a case-independent 'like' comparison. |
|
QSelection<T> |
isnotnull(java.lang.String property)
Add the restriction that the property specified must be not-null. |
|
QSelection<T> |
isnull(java.lang.String property)
Add the restriction that the property specified must be null. |
|
QSelection<T> |
le(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
le(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
le(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
like(java.lang.String property,
java.lang.Object value)
Do a 'like' comparison. |
|
QSelection<T> |
lt(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
lt(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
lt(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
max(java.lang.String property)
Select the max of a property in the set. |
|
QSelection<T> |
max(java.lang.String property,
java.lang.String alias)
Select the max of a property in the set. |
|
QSelection<T> |
min(java.lang.String property)
Select the minimal value of a property in the set. |
|
QSelection<T> |
min(java.lang.String property,
java.lang.String alias)
Select the minimal value of a property in the set. |
|
QSelection<T> |
ne(java.lang.String property,
double value)
Compare a property with some literal object value. |
|
QSelection<T> |
ne(java.lang.String property,
long value)
Compare a property with some literal object value. |
|
QSelection<T> |
ne(java.lang.String property,
java.lang.Object value)
Compare a property with some literal object value. |
|
QSelection<T> |
or(QOperatorNode a1,
QOperatorNode a2,
QOperatorNode... a)
Deprecated. |
|
QSelection<T> |
selectProperty(java.lang.String property)
Select a property value from the base property in the result set. |
|
QSelection<T> |
selectProperty(java.lang.String property,
java.lang.String alias)
Select a property value from the base property in the result set. |
|
QSelection<T> |
sqlCondition(java.lang.String sql)
Add a restriction specified in bare SQL. |
|
QSelection<T> |
sum(java.lang.String property)
Select the sum of a property in the set. |
|
QSelection<T> |
sum(java.lang.String property,
java.lang.String alias)
Select the sum of a property in the set. |
|
java.lang.String |
toString()
|
|
void |
visit(QNodeVisitor v)
|
Methods inherited from class to.etc.webapp.query.QCriteriaQueryBase |
---|
getColumnList, getLimit, getOption, getOrder, getRestrictions, getStart, getTimeout, hasOption, limit, setOption, setRestrictions, setTimeout, start |
Methods inherited from class to.etc.webapp.query.QRestrictor |
---|
and, exists, getBaseClass, getMetaTable, getReturnClass, hasRestrictions, internalAdd, or |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <T> QSelection<T> create(java.lang.Class<T> root)
T
- The base type being queriedroot
- The class representing the base type being queried, thanks to the brilliant Java Generics implementation.
public void visit(QNodeVisitor v) throws java.lang.Exception
java.lang.Exception
public void addColumn(QSelectionItem item, java.lang.String alias)
addColumn
in class QCriteriaQueryBase<T>
public void addPropertySelection(QSelectionFunction f, java.lang.String prop, java.lang.String alias)
addPropertySelection
in class QCriteriaQueryBase<T>
public QSelection<T> avg(java.lang.String property, java.lang.String alias)
avg
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> avg(java.lang.String property)
avg
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> count(java.lang.String property, java.lang.String alias)
count
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> count(java.lang.String property)
count
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> countDistinct(java.lang.String property, java.lang.String alias)
countDistinct
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> countDistinct(java.lang.String property)
countDistinct
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> distinct(java.lang.String property, java.lang.String alias)
distinct
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> distinct(java.lang.String property)
distinct
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> max(java.lang.String property, java.lang.String alias)
max
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> max(java.lang.String property)
max
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> min(java.lang.String property, java.lang.String alias)
min
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> min(java.lang.String property)
min
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> selectProperty(java.lang.String property, java.lang.String alias)
selectProperty
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> selectProperty(java.lang.String property)
selectProperty
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> sum(java.lang.String property, java.lang.String alias)
sum
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selectedalias
- The alias for using the property in the restrictions clause.
public QSelection<T> sum(java.lang.String property)
sum
in class QCriteriaQueryBase<T>
property
- The property whose literal value is to be selected
public QSelection<T> add(QOperatorNode r)
add
in class QRestrictor<T>
QRestrictor.add(to.etc.webapp.query.QOperatorNode)
public QSelection<T> add(QOrder r)
add
in class QCriteriaQueryBase<T>
QCriteriaQueryBase.add(to.etc.webapp.query.QOrder)
public QSelection<T> ascending(java.lang.String property)
ascending
in class QCriteriaQueryBase<T>
QCriteriaQueryBase.ascending(java.lang.String)
public QSelection<T> between(java.lang.String property, java.lang.Object a, java.lang.Object b)
between
in class QRestrictor<T>
QRestrictor.between(java.lang.String, java.lang.Object, java.lang.Object)
public QSelection<T> descending(java.lang.String property)
descending
in class QCriteriaQueryBase<T>
QCriteriaQueryBase.descending(java.lang.String)
public QSelection<T> eq(java.lang.String property, double value)
eq
in class QRestrictor<T>
QRestrictor.eq(java.lang.String, double)
public QSelection<T> eq(java.lang.String property, long value)
eq
in class QRestrictor<T>
QRestrictor.eq(java.lang.String, long)
public QSelection<T> eq(java.lang.String property, java.lang.Object value)
eq
in class QRestrictor<T>
QRestrictor.eq(java.lang.String, java.lang.Object)
public QSelection<T> ge(java.lang.String property, double value)
ge
in class QRestrictor<T>
QRestrictor.ge(java.lang.String, double)
public QSelection<T> ge(java.lang.String property, long value)
ge
in class QRestrictor<T>
QRestrictor.ge(java.lang.String, long)
public QSelection<T> ge(java.lang.String property, java.lang.Object value)
ge
in class QRestrictor<T>
QRestrictor.ge(java.lang.String, java.lang.Object)
public QSelection<T> gt(java.lang.String property, double value)
gt
in class QRestrictor<T>
QRestrictor.gt(java.lang.String, double)
public QSelection<T> gt(java.lang.String property, long value)
gt
in class QRestrictor<T>
QRestrictor.gt(java.lang.String, long)
public QSelection<T> gt(java.lang.String property, java.lang.Object value)
gt
in class QRestrictor<T>
QRestrictor.gt(java.lang.String, java.lang.Object)
public QSelection<T> ilike(java.lang.String property, java.lang.Object value)
ilike
in class QRestrictor<T>
QRestrictor.ilike(java.lang.String, java.lang.Object)
public QSelection<T> isnotnull(java.lang.String property)
isnotnull
in class QRestrictor<T>
QRestrictor.isnotnull(java.lang.String)
public QSelection<T> isnull(java.lang.String property)
isnull
in class QRestrictor<T>
QRestrictor.isnull(java.lang.String)
public QSelection<T> le(java.lang.String property, double value)
le
in class QRestrictor<T>
QRestrictor.le(java.lang.String, double)
public QSelection<T> le(java.lang.String property, long value)
le
in class QRestrictor<T>
QRestrictor.le(java.lang.String, long)
public QSelection<T> le(java.lang.String property, java.lang.Object value)
le
in class QRestrictor<T>
QRestrictor.le(java.lang.String, java.lang.Object)
public QSelection<T> like(java.lang.String property, java.lang.Object value)
like
in class QRestrictor<T>
QRestrictor.like(java.lang.String, java.lang.Object)
public QSelection<T> lt(java.lang.String property, double value)
lt
in class QRestrictor<T>
QRestrictor.lt(java.lang.String, double)
public QSelection<T> lt(java.lang.String property, long value)
lt
in class QRestrictor<T>
QRestrictor.lt(java.lang.String, long)
public QSelection<T> lt(java.lang.String property, java.lang.Object value)
lt
in class QRestrictor<T>
QRestrictor.lt(java.lang.String, java.lang.Object)
public QSelection<T> ne(java.lang.String property, double value)
ne
in class QRestrictor<T>
QRestrictor.ne(java.lang.String, double)
public QSelection<T> ne(java.lang.String property, long value)
ne
in class QRestrictor<T>
QRestrictor.ne(java.lang.String, long)
public QSelection<T> ne(java.lang.String property, java.lang.Object value)
ne
in class QRestrictor<T>
QRestrictor.ne(java.lang.String, java.lang.Object)
@Deprecated public QSelection<T> or(QOperatorNode a1, QOperatorNode a2, QOperatorNode... a)
or
in class QRestrictor<T>
to.etc.webapp.query.QCriteriaQueryBase#or(to.etc.webapp.query.QOperatorNode[])
public QSelection<T> sqlCondition(java.lang.String sql)
sqlCondition
in class QRestrictor<T>
QRestrictor.sqlCondition(java.lang.String)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |