|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.objectstore.query.Query
public class Query
This class provides an implementation-independent abstract representation of a query
| Constructor Summary | |
|---|---|
Query()
Empty constructor. |
|
| Method Summary | |
|---|---|
Query |
addFrom(FromElement cls)
Adds a FromElement to the FROM clause of this Query |
Query |
addFrom(FromElement cls,
java.lang.String alias)
Adds a FromElement to the FROM clause of this Query |
Query |
addToGroupBy(QueryNode node)
Add a QueryNode to the GROUP BY clause of this Query |
Query |
addToOrderBy(QueryOrderable node)
Add a QueryOrderable to the ORDER BY clause of this Query |
Query |
addToOrderBy(QueryOrderable node,
java.lang.String direction)
Add a QueryOrderable to the ORDER BY clause of this Query |
void |
addToSelect(QuerySelectable node)
Add a QuerySelectable to the SELECT clause of this Query |
Query |
addToSelect(QuerySelectable node,
java.lang.String alias)
Add a QuerySelectable to the SELECT clause of this Query |
void |
alias(java.lang.Object obj,
java.lang.String alias)
Set an alias for an element in the Query. |
void |
clearOrderBy()
Clears the ORDER BY clause of this Query |
void |
clearSelect()
Clears the SELECT list |
Query |
deleteFrom(FromElement cls)
Remove a FromElement from the FROM clause |
Query |
deleteFromGroupBy(QueryNode node)
Remove a QueryNode from the GROUP BY clause |
Query |
deleteFromOrderBy(QueryOrderable node)
Remove a QueryOrderable from the ORDER BY clause |
Query |
deleteFromSelect(QuerySelectable node)
Remove a QuerySelectable from the SELECT clause |
java.util.Map<java.lang.Object,java.lang.String> |
getAliases()
Returns the map of QuerySelectables and FromElements to String aliases |
Constraint |
getConstraint()
Get the current constraint on this Query |
java.util.List<java.lang.Object> |
getEffectiveOrderBy()
Gets the effective ORDER BY clause of this Query, such as may be used to create SQL. |
java.util.Set<FromElement> |
getFrom()
Returns all FromElements in the FROM clause |
java.util.Set<QueryNode> |
getGroupBy()
Gets the GROUP BY clause of this Query |
IqlQuery |
getIqlQuery()
Returns an IqlQuery object representing this query, that may have been cached. |
int |
getLimit()
Returns the LIMIT parameter for this query. |
java.util.List<QueryOrderable> |
getOrderBy()
Gets the ORDER BY clause of this Query |
java.util.Map<java.lang.String,java.lang.Object> |
getReverseAliases()
Returns the map of String aliases to QuerySelectables and FromElements |
java.util.List<QuerySelectable> |
getSelect()
Gets the SELECT list |
boolean |
isDistinct()
Get the value of the distinct property |
void |
setConstraint(Constraint constraint)
Constrain this Query using either a single constraint or a set of constraints |
void |
setDistinct(boolean distinct)
Set the value of the distinct property, which determines whether duplicates are permitted in the results returned by this Query |
void |
setLimit(int limit)
Sets the LIMIT parameter for this query - note that this is only honoured in a subquery. |
java.lang.String |
toString()
Returns a string representation of this Query object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Query()
| Method Detail |
|---|
public void setLimit(int limit)
limit - the new limit parameter - the results will be truncated to this many rowspublic int getLimit()
public Query addFrom(FromElement cls)
cls - the FromElement to be added
public Query addFrom(FromElement cls,
java.lang.String alias)
cls - the FromElement to be addedalias - the alias for this FromElement
public Query deleteFrom(FromElement cls)
cls - the FromElement to remove
public java.util.Set<FromElement> getFrom()
public void setConstraint(Constraint constraint)
setConstraint in interface Queryableconstraint - the constraint or constraint setpublic Constraint getConstraint()
getConstraint in interface Queryablepublic Query addToGroupBy(QueryNode node)
node - the node to add
public Query deleteFromGroupBy(QueryNode node)
node - the node to remove
public java.util.Set<QueryNode> getGroupBy()
public Query addToOrderBy(QueryOrderable node)
node - the node to add
public Query addToOrderBy(QueryOrderable node,
java.lang.String direction)
node - the node to adddirection - ascending or descending
public Query deleteFromOrderBy(QueryOrderable node)
node - the node to remove
public void clearOrderBy()
public java.util.List<QueryOrderable> getOrderBy()
public java.util.List<java.lang.Object> getEffectiveOrderBy()
public void addToSelect(QuerySelectable node)
addToSelect in interface Queryablenode - the QuerySelectable to add
public Query addToSelect(QuerySelectable node,
java.lang.String alias)
node - the QuerySelectable to addalias - the alias for this FromElement
public Query deleteFromSelect(QuerySelectable node)
node - the QuerySelectable to remove
public java.util.List<QuerySelectable> getSelect()
getSelect in interface Queryablepublic void clearSelect()
public boolean isDistinct()
public void setDistinct(boolean distinct)
distinct - the value of distinctpublic java.util.Map<java.lang.Object,java.lang.String> getAliases()
public java.util.Map<java.lang.String,java.lang.Object> getReverseAliases()
public java.lang.String toString()
toString in class java.lang.Objectpublic IqlQuery getIqlQuery()
public void alias(java.lang.Object obj,
java.lang.String alias)
obj - the element to aliasalias - the alias to give
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||