Package de.businesscode.bcdui.wrs.load
Class WrqInfo
- java.lang.Object
-
- de.businesscode.bcdui.wrs.load.WrqInfo
-
public class WrqInfo extends java.lang.Object
Collects knowledge about the Wrq. Initially taken from WrsSqlGenerator. For older change history see there
-
-
Field Summary
Fields Modifier and Type Field Description protected SqlFromSubSelect
currentSelect
-
Constructor Summary
Constructors Constructor Description WrqInfo(SqlFromSubSelect currentSelect, org.w3c.dom.Element selectElem)
Constructor from currentSelect as context and our wrq:Select element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,WrqBindingItem>
getAllBRefAggrs()
java.util.Map<java.lang.String,WrqBindingItem>
getAllBRefs()
java.util.Set<java.lang.String>
getAllRawBRefs()
SqlFromSubSelect
getCurrentSelect()
protected java.lang.String
getDefaultAggr(BindingItem bi)
Usually, the aggregation is defined in the Wrq Element e for the column.protected org.w3c.dom.Element
getFilterNode()
java.util.LinkedHashSet<java.lang.String>
getFullSelectListBRefs()
java.util.Set<java.lang.String>
getGroupingBRefs()
org.w3c.dom.NodeList
getGroupingChildNode()
protected org.w3c.dom.Element
getGroupingNode()
java.util.Set<java.lang.String>
getHavingBRefs()
protected org.w3c.dom.Element
getHavingNode()
java.lang.String
getJdbcResourceName()
Convenience methodint
getNextColumnNumber()
BindingItem
getNoMetaDataBindingItem(java.lang.String id)
protected java.util.LinkedHashSet<java.lang.String>
getOrderingBRefs()
org.w3c.dom.Document
getOwnerDocument()
WrqBindingSet
getResultingBindingSet()
org.w3c.dom.Element
getSelectNode()
SQLStatementWithParams
getSQLSelectWithParams()
org.w3c.dom.NodeList
getTopNs()
protected java.util.LinkedHashSet<java.lang.String>
getUserSelectListBRefs()
java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getVdm(java.lang.String bRef)
Return the virtual dimension members for a bRefjava.util.Map<java.lang.String,java.lang.String>
getVirtualBRefs()
WrqGroupBy2Sql
getWrqGroupBy2Sql()
protected java.util.LinkedList<WrsBindingItem>
getWrsCOnlySelectListBRefs()
protected void
initMetaData()
Initializes internal data structures for s single wrq:Selectprotected boolean
isEmpty()
boolean
reqHasGroupBy()
boolean
reqHasGroupingFunction()
protected void
selectAllBindingItems()
No binding items are explicitly given in select clause, collect here all the BindingSet has to offervoid
setReqHasGroupingFunction(java.lang.Boolean reqHasGroupingFunction)
-
-
-
Field Detail
-
currentSelect
protected final SqlFromSubSelect currentSelect
-
-
Constructor Detail
-
WrqInfo
public WrqInfo(SqlFromSubSelect currentSelect, org.w3c.dom.Element selectElem) throws java.lang.Exception
Constructor from currentSelect as context and our wrq:Select element- Parameters:
currentSelect
-selectElem
-- Throws:
java.lang.Exception
-
-
Method Detail
-
isEmpty
protected boolean isEmpty()
-
getOrderingBRefs
protected java.util.LinkedHashSet<java.lang.String> getOrderingBRefs()
-
getFullSelectListBRefs
public java.util.LinkedHashSet<java.lang.String> getFullSelectListBRefs()
-
getUserSelectListBRefs
protected java.util.LinkedHashSet<java.lang.String> getUserSelectListBRefs()
-
getWrsCOnlySelectListBRefs
protected java.util.LinkedList<WrsBindingItem> getWrsCOnlySelectListBRefs()
-
getFilterNode
protected org.w3c.dom.Element getFilterNode() throws javax.xml.xpath.XPathExpressionException
- Throws:
javax.xml.xpath.XPathExpressionException
-
getGroupingNode
protected org.w3c.dom.Element getGroupingNode() throws javax.xml.xpath.XPathExpressionException
- Throws:
javax.xml.xpath.XPathExpressionException
-
getHavingNode
protected org.w3c.dom.Element getHavingNode() throws javax.xml.xpath.XPathExpressionException
- Throws:
javax.xml.xpath.XPathExpressionException
-
initMetaData
protected void initMetaData() throws java.lang.Exception
Initializes internal data structures for s single wrq:Select- Throws:
java.lang.Exception
-
selectAllBindingItems
protected void selectAllBindingItems() throws BindingException
No binding items are explicitly given in select clause, collect here all the BindingSet has to offer- Throws:
BindingException
-
getDefaultAggr
protected java.lang.String getDefaultAggr(BindingItem bi)
Usually, the aggregation is defined in the Wrq Element e for the column. There are two cases where not: It is not given (select all, no explicit select list), or the attribute is simply not set. Then we have this mechanism for default-aggregator, the returned aggregator can be trusted (i.e. no SQL injection can happen within this fkt) 1) Wrq/Columns/C/@aggr 2) BindingSet/BindingItem/@aggr 3) MAX() or SUM() depending on the BindingItems data type- Parameters:
bi
-- Returns:
-
getOwnerDocument
public org.w3c.dom.Document getOwnerDocument()
-
getSelectNode
public org.w3c.dom.Element getSelectNode()
-
getAllBRefAggrs
public java.util.Map<java.lang.String,WrqBindingItem> getAllBRefAggrs()
-
getAllBRefs
public java.util.Map<java.lang.String,WrqBindingItem> getAllBRefs()
-
getVirtualBRefs
public java.util.Map<java.lang.String,java.lang.String> getVirtualBRefs()
-
getAllRawBRefs
public java.util.Set<java.lang.String> getAllRawBRefs()
-
getNoMetaDataBindingItem
public BindingItem getNoMetaDataBindingItem(java.lang.String id) throws BindingNotFoundException
- Throws:
BindingNotFoundException
-
getGroupingChildNode
public org.w3c.dom.NodeList getGroupingChildNode() throws javax.xml.xpath.XPathExpressionException
- Throws:
javax.xml.xpath.XPathExpressionException
-
getTopNs
public org.w3c.dom.NodeList getTopNs() throws javax.xml.xpath.XPathExpressionException
- Throws:
javax.xml.xpath.XPathExpressionException
-
getNextColumnNumber
public int getNextColumnNumber()
-
getResultingBindingSet
public WrqBindingSet getResultingBindingSet()
-
getGroupingBRefs
public java.util.Set<java.lang.String> getGroupingBRefs()
-
getHavingBRefs
public java.util.Set<java.lang.String> getHavingBRefs()
-
reqHasGroupingFunction
public boolean reqHasGroupingFunction()
-
reqHasGroupBy
public boolean reqHasGroupBy()
-
setReqHasGroupingFunction
public void setReqHasGroupingFunction(java.lang.Boolean reqHasGroupingFunction)
-
getJdbcResourceName
public java.lang.String getJdbcResourceName()
Convenience method- Returns:
-
getCurrentSelect
public SqlFromSubSelect getCurrentSelect()
-
getSQLSelectWithParams
public SQLStatementWithParams getSQLSelectWithParams()
-
getVdm
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getVdm(java.lang.String bRef)
Return the virtual dimension members for a bRef- Parameters:
bRef
-- Returns:
-
getWrqGroupBy2Sql
public WrqGroupBy2Sql getWrqGroupBy2Sql()
-
-