|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.datavision.source.Query
public class Query
A data source query.
| Field Summary | |
|---|---|
protected java.util.ArrayList |
joins
|
protected Report |
report
|
protected java.util.ArrayList |
selectables
|
static int |
SORT_ASCENDING
|
static int |
SORT_DESCENDING
|
static int |
SORT_UNDEFINED
|
protected java.util.ArrayList |
sortOrders
|
protected java.util.ArrayList |
sortSelectables
|
protected java.lang.String |
whereClause
|
| Constructor Summary | |
|---|---|
Query(Report r)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addAllJoins(java.util.Collection coll)
Adds all joins in the collection to our list. |
void |
addJoin(Join join)
Adds a join to the list of joins used by this query. |
void |
addSort(Selectable sel,
int order)
Adds a sort order for the specified selectable. |
void |
clearJoins()
Removes all joins in the collection from our list. |
void |
clearSorts()
Removes all sorts from our list. |
boolean |
containsReferenceTo(Parameter p)
Returns true if the specified parameter exists within this
query's where clause. |
void |
findSelectablesUsed()
Builds collections of the selectables actually used in the report. |
java.lang.String |
getEditableWhereClause()
Returns the where clause fit for human consumption. |
int |
getNumSelectables()
Returns the number of selectables in the query. |
java.lang.String |
getWhereClause()
Returns the raw where clause string; may be null. |
int |
indexOfSelectable(Selectable selectable)
Returns the index of the specified selectable. |
java.util.Iterator |
joins()
Returns an iterator over all the joins used by this query. |
void |
reloadColumns(DataSource dataSource)
Called from DataSource.reloadColumns, this method gives the
query source a chance to tell its ancillary objects (such as joins and
the sort) to reload selectable objects. |
void |
removeJoin(Join join)
Removes a join from the list of joins used by this query. |
void |
removeSort(Selectable sel)
Removes a sorting from the list. |
java.util.Iterator |
selectables()
Returns an iterator over all selectables. |
void |
setEditableWhereClause(java.lang.String newWhereClause)
Sets the where clause (may be null). |
void |
setWhereClause(java.lang.String newWhereClause)
Sets the where clause (may be null). |
java.util.Iterator |
sortedSelectables()
Returns an iterator over all the sorted selectables used by this query. |
int |
sortOrderOf(Selectable sel)
Returns the sort order ( SORT_DESCENDING,
SORT_ASCENDING, or SORT_UNDEFINED) of the
specified selectable. |
protected void |
writeExtras(XMLWriter out)
This method exists so subclasses can write out extra information. |
void |
writeXML(XMLWriter out)
Writes this query as an XML tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SORT_UNDEFINED
public static final int SORT_DESCENDING
public static final int SORT_ASCENDING
protected Report report
protected java.util.ArrayList joins
protected java.lang.String whereClause
protected java.util.ArrayList sortSelectables
protected java.util.ArrayList sortOrders
protected java.util.ArrayList selectables
| Constructor Detail |
|---|
public Query(Report r)
r - the report for which this query will retrieve data| Method Detail |
|---|
public boolean containsReferenceTo(Parameter p)
true if the specified parameter exists within this
query's where clause.
p - a parameter
true if the specified parameter exists within
the where clausepublic void addJoin(Join join)
join - a joinpublic void addAllJoins(java.util.Collection coll)
coll - a collection of joinspublic void removeJoin(Join join)
join - a joinpublic void clearJoins()
public java.util.Iterator joins()
public java.lang.String getEditableWhereClause()
WhereClauseWinpublic java.lang.String getWhereClause()
null.
nullpublic void setEditableWhereClause(java.lang.String newWhereClause)
null). The string passed
to us contains parameter and formula display strings, not their
"real" formulaString representations. Translate the latter
into the former before saving this string.
newWhereClause - a where clause string; may be nullpublic void setWhereClause(java.lang.String newWhereClause)
null).
newWhereClause - a where clause string; may be null
public void addSort(Selectable sel,
int order)
sel - a selectableorder - either SORT_DESCENDING or
SORT_ASCENDINGpublic void removeSort(Selectable sel)
sel - a selectablepublic void clearSorts()
public java.util.Iterator selectables()
public java.util.Iterator sortedSelectables()
public int sortOrderOf(Selectable sel)
SORT_DESCENDING,
SORT_ASCENDING, or SORT_UNDEFINED) of the
specified selectable.
sel - a database selectable
SORT_DESCENDING,
SORT_ASCENDING, or SORT_UNDEFINED) of the
specified selectable.public int indexOfSelectable(Selectable selectable)
selectable - a database selectablepublic void findSelectablesUsed()
public int getNumSelectables()
findSelectablesUsed() has been called.
public void reloadColumns(DataSource dataSource)
DataSource.reloadColumns, this method gives the
query source a chance to tell its ancillary objects (such as joins and
the sort) to reload selectable objects.
This is necessary, for example, after a SQL database data source has reloaded all of its table and column information. The old column objects no longer exist. New ones (with the same ids, we assume) have taken their place.
dataSource - the data sourcepublic void writeXML(XMLWriter out)
writeXML in interface Writeableout - a writer that knows how to write XMLprotected void writeExtras(XMLWriter out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||