|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jimm.datavision.source.Query jimm.datavision.source.sql.SQLQuery jimm.datavision.source.sql.SubreportQuery
public class SubreportQuery
Queries build SQL query strings. They contain tables, joins, and where clauses.
ParserHelper
Field Summary | |
---|---|
protected Subreport |
subreport
|
protected java.util.ArrayList |
subreportJoins
|
Fields inherited from class jimm.datavision.source.sql.SQLQuery |
---|
preparedStmtValues, tables |
Fields inherited from class jimm.datavision.source.Query |
---|
joins, report, selectables, SORT_ASCENDING, SORT_DESCENDING, SORT_UNDEFINED, sortOrders, sortSelectables, whereClause |
Constructor Summary | |
---|---|
SubreportQuery(Subreport report)
Constructor. |
Method Summary | |
---|---|
void |
addSubreportJoin(Join join)
|
void |
addSubreportJoins(java.util.Collection coll)
|
protected void |
buildWhereClause(java.lang.StringBuffer str,
boolean forDisplay)
|
java.lang.String |
getWhereClauseForDisplay()
Returns the where clause string; may be null . |
java.lang.String |
getWhereClauseForPreparedStatement()
Returns the where clause string; may be null . |
java.util.Iterator |
parentColumns()
Returns an iterator over all of the columns that need to be included in the parent report's query so that the values are available to this subreport when it builds its query. |
void |
setParameters(java.sql.PreparedStatement stmt)
Given a prepared statement created with the text returned by toPreparedStatementString , plug in all the parameter
and formula values. |
protected void |
writeExtras(XMLWriter out)
This method exists so subclasses can write out extra information. |
Methods inherited from class jimm.datavision.source.sql.SQLQuery |
---|
addParameter, addParameterForDisplay, addTable, buildFrom, buildJoins, buildOrderBy, buildSelect, buildUserWhereClause, findSelectablesUsed, getNumTables, getTablesUsed, prepare, queryAsString, quoted, toPreparedStatementString, toString |
Methods inherited from class jimm.datavision.source.Query |
---|
addAllJoins, addJoin, addSort, clearJoins, clearSorts, containsReferenceTo, getEditableWhereClause, getNumSelectables, getWhereClause, indexOfSelectable, joins, reloadColumns, removeJoin, removeSort, selectables, setEditableWhereClause, setWhereClause, sortedSelectables, sortOrderOf, writeXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Subreport subreport
protected java.util.ArrayList subreportJoins
Constructor Detail |
---|
public SubreportQuery(Subreport report)
report
- the report for which this query will generate SQLMethod Detail |
---|
public void addSubreportJoin(Join join)
public void addSubreportJoins(java.util.Collection coll)
public java.util.Iterator parentColumns()
protected void buildWhereClause(java.lang.StringBuffer str, boolean forDisplay)
buildWhereClause
in class SQLQuery
public java.lang.String getWhereClauseForDisplay()
SQLQuery
null
. If there are
any column names contained in curly braces, we remove the curly braces.
Formulas, parameters, and user colums remain as-is.
Implementation note: we can't use StringUtils.replaceDelimited
because we modify the symbol that appears before some of the
delimited items.
getWhereClauseForDisplay
in class SQLQuery
null
Query.getWhereClause()
public java.lang.String getWhereClauseForPreparedStatement()
SQLQuery
null
. If there
are any parameter values, we return '?' in their place and save the
values for later use.
This code may also modify the clause. For example, a parameter can change the previous comparison operator ("=", "is") based on its arity.
getWhereClauseForPreparedStatement
in class SQLQuery
null
Query.getWhereClause()
public void setParameters(java.sql.PreparedStatement stmt) throws java.sql.SQLException
SQLQuery
toPreparedStatementString
, plug in all the parameter
and formula values.
setParameters
in class SQLQuery
java.sql.SQLException
SQLQuery.toPreparedStatementString()
protected void writeExtras(XMLWriter out)
Query
writeExtras
in class Query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |