public class Query
extends java.lang.Object
Constructor and Description |
---|
Query(com.groiss.reporting.StoredQuery q,
java.util.Map<java.lang.String,java.lang.String[]> paramMap)
Constructs q query for internal use
|
Query(java.lang.String id,
java.lang.String title,
Document xml,
java.util.Date execution,
javax.servlet.http.HttpServletRequest req) |
Query(java.lang.String id,
java.lang.String title,
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,
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
|
Query(java.lang.String id,
java.lang.String title,
Document xml,
java.util.Date execution,
java.util.Map<java.lang.String,java.lang.String[]> paramMap,
com.groiss.reporting.StoredQuery q,
boolean doSQLInit) |
Modifier and Type | Method and Description |
---|---|
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.Integer att)
use this method to order resultset to calculate AggregateValue Types correctly
|
void |
addOrderByForAggregateValueData(java.lang.String att)
Deprecated.
since 9.0.18429 use
#addOrderByForAggregateValueData(int) instead |
boolean |
addRowNumber() |
int |
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 |
addSelectIndexOfAttrib(Element attribute,
int name)
stores the attributenames gained from
addSelect(String, String, String, String, boolean, boolean) |
void |
addSelectNameOfAttrib(Element attribute,
java.lang.String name)
Deprecated.
since 9.0.18429 use
addSelectIndexOfAttrib(Element, int) instead |
void |
addTempJoin(java.lang.String key1,
java.lang.String key2,
Element rel) |
boolean |
containsTable(java.lang.String table,
java.lang.String alias) |
boolean |
finishedParamMask() |
boolean |
getAddArchive() |
ReportingGraph<java.lang.String,com.groiss.reporting.data.impl.Relation> |
getAliasAndJoins() |
java.util.List<Element> |
getAttributes()
returns a list of all attributes of this query
|
int |
getCondCountWithParams() |
int |
getConditionCount()
get the number of the current condition. is needed in
ReportingData.addConditionToQuery(Query, Element) to gain the maybe already filled parameter at execution values from parametermap |
java.lang.StringBuilder |
getConditionString() |
java.util.Map<java.lang.Integer,Element> |
getCondNeedsParam() |
java.lang.String |
getDispStringForAttriubtes(Element attr,
boolean addSortPattern)
returns a displayname for the attribute
|
java.lang.String |
getDispStringForConditions(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(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... if param has several values, they are returned seperated by a semicolon
|
java.util.Map<java.lang.String,? extends java.lang.Object> |
getParamMap()
get the Parameter Map of this query
|
java.lang.String |
getParamMask() |
java.util.Map<java.lang.String,java.lang.String> |
getQueryInformations() |
ReportingData |
getReportingDataInstance(Element attr) |
protected static java.util.Map<java.lang.String,java.lang.String[]> |
getReqParamMap(javax.servlet.http.HttpServletRequest req) |
Resource |
getResource() |
com.groiss.reporting.ResultModifier |
getResultModifier() |
com.groiss.reporting.StoredQuery |
getRootStoredQuery() |
java.util.List<java.lang.Integer> |
getSelectIndexOfAttribs(Element attribute) |
java.util.List<java.lang.String> |
getSelectNamesOfAttribs(Element attribute)
Deprecated.
since 9.0.18429 use
getSelectIndexOfAttribs(Element) instead |
java.lang.String |
getSqlQueryString()
get the sql query string
|
MultiMap<java.lang.String,java.lang.String> |
getTableAndAliases() |
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
|
Document |
getXMLDoc()
returns the xml document describing this query
|
static boolean |
isAttributeTypeClob(Entity e,
Attribute a) |
protected boolean |
isDistinct() |
protected boolean |
isExecutable() |
java.lang.String |
lockOperatorInParamMaskMode() |
boolean |
queryHasClobSelects() |
void |
setTitle(java.lang.String title)
Set the displayed title of the query
|
boolean |
shallLockOperatorInParamMask() |
java.lang.String[] |
splitIntoTableAndAlias(java.lang.String key) |
public Query(java.lang.String id, java.lang.String title, 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, 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(com.groiss.reporting.StoredQuery q, java.util.Map<java.lang.String,java.lang.String[]> paramMap)
q
- the StoredQueryparamMap
- a map of parameters to execute the querypublic Query(java.lang.String id, java.lang.String title, 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 mappublic Query(java.lang.String id, java.lang.String title, Document xml, java.util.Date execution, java.util.Map<java.lang.String,java.lang.String[]> paramMap, com.groiss.reporting.StoredQuery q, boolean doSQLInit)
public 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 parametermappublic java.util.Map<java.lang.String,? extends java.lang.Object> getParamMap()
public java.lang.String getParam(java.lang.String key)
key
- - the param namepublic int 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
otherwisepublic 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 condition@Deprecated public void addOrderByForAggregateValueData(java.lang.String att)
#addOrderByForAggregateValueData(int)
insteadpublic void addOrderByForAggregateValueData(java.lang.Integer att)
public boolean containsTable(java.lang.String table, java.lang.String alias)
table
- - the tablename in databasealias
- - the used tablealiastrue
if table is already added with thos aliaspublic void addTempJoin(java.lang.String key1, java.lang.String key2, Element rel)
public java.lang.String getSqlQueryString()
public java.util.List<java.lang.Object> getValues()
public java.util.List<Element> getAttributes()
public java.util.List<java.lang.Integer> getSelectIndexOfAttribs(Element attribute)
attribute
- - the attribute@Deprecated public java.util.List<java.lang.String> getSelectNamesOfAttribs(Element attribute)
getSelectIndexOfAttribs(Element)
insteadattribute
- - the attribute@Deprecated public void addSelectNameOfAttrib(Element attribute, java.lang.String name)
addSelectIndexOfAttrib(Element, int)
insteadaddSelect(String, String, String, String, boolean, boolean)
attribute
- - the attribute, which caused this select statementname
- - the attribute name in the sql querypublic void addSelectIndexOfAttrib(Element attribute, int name)
addSelect(String, String, String, String, boolean, boolean)
attribute
- - the attribute, which caused this select statementname
- - the attribute index in the sql querypublic java.lang.String[] splitIntoTableAndAlias(java.lang.String key)
public MultiMap<java.lang.String,java.lang.String> getTableAndAliases()
public ReportingGraph<java.lang.String,com.groiss.reporting.data.impl.Relation> getAliasAndJoins()
public java.util.Date getExecutionTime()
public boolean getAddArchive()
true
if query includes data from archive schemapublic java.util.Map<java.lang.Integer,Element> getCondNeedsParam()
public java.lang.StringBuilder getConditionString()
public java.lang.String getDispStringForAttriubtes(Element attr, boolean addSortPattern)
attr
- - attributeaddSortPattern
- - if true
the sortpaterns %ASC%, %DESC% and %NONE%
are added to the displaynamepublic java.lang.String getDispStringForConditions(Element c)
c
- - conditionpublic ReportingExporter getExporter()
public java.lang.String getExportingParam(java.lang.String key)
key
- - the name of the exporting parameterpublic static Pair<ReportingExporter,java.util.Map<java.lang.String,java.lang.String>> getExporterInfos(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...protected static java.util.Map<java.lang.String,java.lang.String[]> getReqParamMap(javax.servlet.http.HttpServletRequest req)
public boolean addRowNumber()
true
if report should include row numberspublic java.lang.String getParamMask()
public int getCondCountWithParams()
public java.lang.String lockOperatorInParamMaskMode()
TRUE
if operator shall be readonly in parammask
HIDE
if operator shall be hidden in parammask
FALSE
otherwisepublic 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()
protected int getMaxTableResult()
public java.util.Map<java.lang.String,java.lang.String> getQueryInformations()
public com.groiss.reporting.ResultModifier getResultModifier()
public com.groiss.reporting.StoredQuery getRootStoredQuery()
public boolean finishedParamMask()
public ReportingData getReportingDataInstance(Element attr)
attr
- @enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.