|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.reporting.Query
public class Query
Class describing a report. Holds all Informations given by Query-XML and Request.
Constructor Summary | |
---|---|
Query(java.lang.String id,
java.lang.String title,
org.jdom.Document xml,
java.util.Date execution,
javax.servlet.http.HttpServletRequest req)
|
|
Query(java.lang.String id,
java.lang.String title,
org.jdom.Document xml,
java.util.Date execution,
javax.servlet.http.HttpServletRequest req,
com.groiss.reporting.StoredQuery sq)
|
|
Query(java.lang.String id,
java.lang.String title,
org.jdom.Document xml,
java.util.Date execution,
java.util.Map<java.lang.String,java.lang.String[]> paramMap,
com.groiss.reporting.StoredQuery q)
Constructs a Query, builds the SQL Statement |
Method Summary | |
---|---|
void |
addCondition(java.lang.String tablename,
java.lang.String alias,
java.lang.String condition,
java.lang.String selection,
java.util.List<?> condValues)
Add a condition to the query |
void |
addOrderByForAggregateValueData(java.lang.String att)
use this method to order resultset to calculate AggregateValue Types correctly |
boolean |
addRowNumber()
|
java.lang.String |
addSelect(java.lang.String tablename,
java.lang.String selectAttribute,
java.lang.String alias,
java.lang.String selection,
boolean addToGroupBy,
boolean addAliasAsPrefix)
Adds a select Attribute to the query. |
void |
addSelectNameOfAttrib(org.jdom.Element attribute,
java.lang.String name)
stores the attributenames gained from @link #addSelect(String, String, String, String, boolean, boolean) |
void |
addTempJoin(java.lang.String key1,
java.lang.String key2,
org.jdom.Element rel)
|
boolean |
containsTable(java.lang.String table,
java.lang.String alias)
|
boolean |
getAddArchive()
|
java.util.List<org.jdom.Element> |
getAttributes()
returns a list of all attributes of this query |
int |
getCondCountWithParams()
|
int |
getConditionCount()
get the number of the current condition. |
java.lang.StringBuilder |
getConditionString()
|
java.lang.String |
getDispStringForAttriubtes(org.jdom.Element attr,
boolean addSortPattern)
returns a displayname for the attribute |
java.lang.String |
getDispStringForConditions(org.jdom.Element c)
returns a displayname for the condtion c |
java.util.Date |
getExecutionTime()
the execution timestamp of the query |
ReportingExporter |
getExporter()
|
static Pair<ReportingExporter,java.util.Map<java.lang.String,java.lang.String>> |
getExporterInfos(org.jdom.Document xml)
get Exportinginformation from xml-document |
java.lang.String |
getExportingParam(java.lang.String key)
|
java.lang.String |
getId()
returns the id of this query |
protected int |
getMaxTableResult()
|
java.lang.String |
getMaxUnit()
get the max unit of timeintervals used in this query |
java.lang.String |
getMinUnit()
get the min unit of timeintervals used in this query |
java.lang.String |
getParam(java.lang.String key)
Returns the parameter from Map... |
java.util.Map<java.lang.String,? extends java.lang.Object> |
getParamMap()
get the Parameter Map of this query |
Resource |
getResource()
|
java.util.List<java.lang.String> |
getSelectNamesOfAttribs(org.jdom.Element attribute)
|
java.lang.String |
getSqlQueryString()
get the sql query string |
com.groiss.reporting.StoredQuery |
getStoredQuery()
|
TimeModel |
getTimemodel()
get the timemodel used by this query |
java.lang.String |
getTitle()
|
java.util.List<java.lang.Object> |
getValues()
get a List of values of the prepared statement |
org.jdom.Document |
getXMLDoc()
returns the xml document describing this query |
static boolean |
isAttributeTypeClob(Entity e,
Attribute a)
|
protected boolean |
isDistinct()
|
protected boolean |
isExecutable()
|
boolean |
queryHasClobSelects()
|
void |
setTitle(java.lang.String title)
Set the displayed title of the query |
boolean |
shallLockOperatorInParamMask()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Query(java.lang.String id, java.lang.String title, org.jdom.Document xml, java.util.Date execution, javax.servlet.http.HttpServletRequest req)
id
- the id of the querytitle
- the title to show in resultxml
- the xml document defining the reportexecution
- timestamp which is taken as execution time to calculate time intevalsreq
- - the HttpServletRequest parameter Map is used for Query(String, String, Document, Date, Map, StoredQuery)
Query(String, String, Document, Date, Map, StoredQuery)
public Query(java.lang.String id, java.lang.String title, org.jdom.Document xml, java.util.Date execution, javax.servlet.http.HttpServletRequest req, com.groiss.reporting.StoredQuery sq)
id
- the id of the querytitle
- the title to show in resultxml
- the xml document defining the reportexecution
- timestamp which is taken as execution time to calculate time intevalsreq
- the HttpServletRequest parameter Map is used for Query(String, String, Document, Date, Map, StoredQuery)
sq
- the storedquery object defining this reportQuery(String, String, Document, Date, Map, StoredQuery)
public Query(java.lang.String id, java.lang.String title, org.jdom.Document xml, java.util.Date execution, java.util.Map<java.lang.String,java.lang.String[]> paramMap, com.groiss.reporting.StoredQuery q)
id
- the id of querytitle
- the query titlexml
- the xml documents descibing the queryexecution
- the timestamp of executionparamMap
- a map with parameters (e.g. params at execution), usually all request params are stored in this mapMethod Detail |
---|
public org.jdom.Document getXMLDoc()
public java.lang.String getId()
public TimeModel getTimemodel()
public java.lang.String getMaxUnit()
public java.lang.String getMinUnit()
public int getConditionCount()
ReportingData.addConditionToQuery(Query, Element)
to gain the maybe already filled parameter at execution values from parametermap
public java.util.Map<java.lang.String,? extends java.lang.Object> getParamMap()
public java.lang.String getParam(java.lang.String key)
key
- - the param name
public java.lang.String addSelect(java.lang.String tablename, java.lang.String selectAttribute, java.lang.String alias, java.lang.String selection, boolean addToGroupBy, boolean addAliasAsPrefix)
tablename
- - the tablename in databaseselectAttribute
- - the sql select statementalias
- - the used tablealiasselection
- - an additional (additional to the selection defined in schema) selection to the table if neededaddToGroupBy
- - false
if sqlaggr is the selected aggregation. false
otherwiseaddAliasAsPrefix
- - true
if tablealias shoulb be added in front of selectAttribute. false
otherwise
public void addCondition(java.lang.String tablename, java.lang.String alias, java.lang.String condition, java.lang.String selection, java.util.List<?> condValues)
tablename
- - the tablename in databasealias
- - the used tablealiascondition
- - the condition stringselection
- - an additional (additional to the selection defined in schema) selection to the table if neededcondValues
- - a vector with values for the prepared statement. There has to be an element in the vector for each ?
in conditionpublic void addOrderByForAggregateValueData(java.lang.String att)
public boolean containsTable(java.lang.String table, java.lang.String alias)
table
- - the tablename in databasealias
- - the used tablealias
true
if table is already added with thos aliaspublic void addTempJoin(java.lang.String key1, java.lang.String key2, org.jdom.Element rel)
public java.lang.String getSqlQueryString()
public java.util.List<java.lang.Object> getValues()
public java.util.List<org.jdom.Element> getAttributes()
public java.util.List<java.lang.String> getSelectNamesOfAttribs(org.jdom.Element attribute)
attribute
- - the attribute
public void addSelectNameOfAttrib(org.jdom.Element attribute, java.lang.String name)
attribute
- - the attribute, which caused this select statementname
- - the attribute name in the sql querypublic java.util.Date getExecutionTime()
public boolean getAddArchive()
true
if query includes data from archive schemapublic java.lang.StringBuilder getConditionString()
public java.lang.String getDispStringForAttriubtes(org.jdom.Element attr, boolean addSortPattern)
attr
- - attributeaddSortPattern
- - if true
the sortpaterns %ASC%, %DESC% and %NONE%
are added to the displayname
public java.lang.String getDispStringForConditions(org.jdom.Element c)
c
- - condition
public ReportingExporter getExporter()
public java.lang.String getExportingParam(java.lang.String key)
key
- - the name of the exorting parameter
public static Pair<ReportingExporter,java.util.Map<java.lang.String,java.lang.String>> getExporterInfos(org.jdom.Document xml)
xml
-
public java.lang.String getTitle()
protected boolean isExecutable()
true
if query is already executeable...protected boolean isDistinct()
true
if query does not display equal rows twice...public boolean addRowNumber()
true
if report should include row numberspublic int getCondCountWithParams()
public boolean shallLockOperatorInParamMask()
true
if operator shall be readonly in parammaskpublic Resource getResource()
public void setTitle(java.lang.String title)
title
- - the title string. this String is given to Resource.localize of the Query, so you may use I18N Keys.public boolean queryHasClobSelects()
public static boolean isAttributeTypeClob(Entity e, Attribute a)
protected int getMaxTableResult()
public com.groiss.reporting.StoredQuery getStoredQuery()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |