Package de.businesscode.bcdui.wrs.load
Class WrqBindingItem
java.lang.Object
de.businesscode.bcdui.wrs.load.WrqBindingItem
- All Implemented Interfaces:
WrsBindingItem
Represents a BindingItem in a Wrq, it is it has knowledge of the underlying BindingItem and the current query
There can be multiple WrqBindingItem for a BindingItem(FromRel), to reflect different behaviora like aggr for example in select and in grouping clause
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WrqBindingItem
(WrqInfo wrqInfo, String id, BindingItem bi, String alias, boolean enforceAggr) Used for creating a BindingItem from the info of a BindingSetprotected
WrqBindingItem
(WrqInfo wrqInfo, String wrsAName, String aggr, String alias, WrqBindingItem parentC, String columnExpression) Used for creating an artificial wrs:A attributeprotected
WrqBindingItem
(WrqInfo wrqInfo, Element elem, String alias, boolean enforceAggr) Used to derive a BindingItem from a wrs:C, it is combined with the info from the BindingSet but the WrsRequest provided info wins in case of conflictprotected
WrqBindingItem
(WrqInfo wrqInfo, Element elem, String alias, boolean enforceAggr, WrqBindingItem parentWrqC) Used to derive a BindingItem from a wrs:C/wrs:A, it is combined with the info from the BindingSet but the WrsRequest provided info wins in case of conflict If parentWrqC is not null, then this is a wrs:A -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWrsAAttribute
(WrqBindingItem wrsAttr) getAggr()
getAlias()
getAttribute
(String name) Return the physical DB column expression including virtual dimension member caused adjustmentsReturns the column expression with aggregation applied, if any is setgetColumnExpressionWithAggr
(boolean enforceAggr) Returns the column expression with aggregation applied, if any is set or if enforceAggr=trueint
protected static String
getDefaultAggr
(int dataType) Usually, the aggregation is defined in the Wrq Element e for the column.getId()
Return the column expression with the table aliasgetQColumnExpression
(boolean applyVdm) Return the column expression with the table aliasReturns the column expression with table alias and with aggregation applied, if any is setgetQColumnExpressionWithAggr
(boolean enforceAggr) Returns the column expression with table alias and with aggregation applied, if any is set or if enforceAggr=trueUsed to identify column reference parts in a SQL Column expressions to allow for prepending table aliasgetSplitColumnExpression
(boolean applyVdm) Used to identify column reference parts in a SQL Column expressions to allow for prepending table aliasUsually the table alias is derived from the wrq-table alias with which this bindingItem is referenced b.country will be taken from the table that is associated with the wrq table alias "b" This value is created during each query.boolean
boolean
boolean
boolean
void
Derive the column expression< Note that for VDM, this relies on plainColumnExpression and jdbcDataType being set already to this.void
setColumnNumber
(int columnNumber) void
setOrderByDescending
(boolean isDescending) void
setTableAliasOverwrite
(String tableAlias) void
toXML
(XMLStreamWriter writer, boolean withColumnExpression)
-
Field Details
-
attributes
-
-
Constructor Details
-
WrqBindingItem
protected WrqBindingItem(WrqInfo wrqInfo, Element elem, String alias, boolean enforceAggr) throws Exception Used to derive a BindingItem from a wrs:C, it is combined with the info from the BindingSet but the WrsRequest provided info wins in case of conflict- Throws:
Exception
-
WrqBindingItem
protected WrqBindingItem(WrqInfo wrqInfo, Element elem, String alias, boolean enforceAggr, WrqBindingItem parentWrqC) throws Exception Used to derive a BindingItem from a wrs:C/wrs:A, it is combined with the info from the BindingSet but the WrsRequest provided info wins in case of conflict If parentWrqC is not null, then this is a wrs:A- Parameters:
wrqInfo
-elem
-alias
-enforceAggr
-parentWrqC
-- Throws:
Exception
-
WrqBindingItem
protected WrqBindingItem(WrqInfo wrqInfo, String wrsAName, String aggr, String alias, WrqBindingItem parentC, String columnExpression) Used for creating an artificial wrs:A attribute- Parameters:
wrqInfo
-wrsAName
-aggr
-alias
-parentC
-columnExpression
-
-
WrqBindingItem
protected WrqBindingItem(WrqInfo wrqInfo, String id, BindingItem bi, String alias, boolean enforceAggr) Used for creating a BindingItem from the info of a BindingSet- Parameters:
wrqInfo
-bi
-alias
-enforceAggr
-
-
-
Method Details
-
getDefaultAggr
Usually, the aggregation is defined in the Wrq Element e for the column. There are two cases where not: is not given (select all, no select list), or the attribute is simply not set. Then we have this mechanism for default-aggregator 1) Wrq/Columns/C/@aggr 2) BindingSet/BindingItem/@aggr 3) MAX() or SUM() depending on the BindingItems data type- Parameters:
dataType
-- Returns:
-
getAlias
- Specified by:
getAlias
in interfaceWrsBindingItem
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceWrsBindingItem
-
setColumnNumber
public void setColumnNumber(int columnNumber) -
isEscapeXML
- Specified by:
isEscapeXML
in interfaceWrsBindingItem
-
toXML
- Specified by:
toXML
in interfaceWrsBindingItem
- Throws:
XMLStreamException
-
hasWrsAAttributes
public boolean hasWrsAAttributes()- Specified by:
hasWrsAAttributes
in interfaceWrsBindingItem
-
getWrsAAttributes
- Specified by:
getWrsAAttributes
in interfaceWrsBindingItem
-
addWrsAAttribute
-
getJDBCDataType
- Specified by:
getJDBCDataType
in interfaceWrsBindingItem
-
getWrsAName
- Specified by:
getWrsAName
in interfaceWrsBindingItem
-
getId
- Specified by:
getId
in interfaceWrsBindingItem
-
getAggr
-
isOrderByDescending
public boolean isOrderByDescending() -
setOrderByDescending
public void setOrderByDescending(boolean isDescending) -
getSplitColumnExpression
Used to identify column reference parts in a SQL Column expressions to allow for prepending table alias- Returns:
-
getSplitColumnExpression
Used to identify column reference parts in a SQL Column expressions to allow for prepending table alias- Parameters:
applyVdm
- If false, virtual dimension member caused case-when are ignored here- Returns:
-
getQColumnExpressionWithAggr
Returns the column expression with table alias and with aggregation applied, if any is set- Returns:
- Throws:
BindingNotFoundException
-
getQColumnExpressionWithAggr
Returns the column expression with table alias and with aggregation applied, if any is set or if enforceAggr=true- Returns:
- Throws:
BindingNotFoundException
-
getColumnExpressionWithAggr
Returns the column expression with aggregation applied, if any is set- Returns:
-
getColumnExpressionWithAggr
Returns the column expression with aggregation applied, if any is set or if enforceAggr=true- Returns:
-
hasAColumnReference
public boolean hasAColumnReference() -
getQColumnExpression
Return the column expression with the table alias- Returns:
- Throws:
BindingNotFoundException
-
getQColumnExpression
Return the column expression with the table alias- Parameters:
applyVdm
- If false, virtual dimension members are ignored here- Returns:
- Throws:
BindingNotFoundException
-
getColumnExpression
Return the physical DB column expression including virtual dimension member caused adjustments- Returns:
-
setColumnExpression
Derive the column expression< Note that for VDM, this relies on plainColumnExpression and jdbcDataType being set already to this.- Parameters:
cE
-
-
getTableAlias
Usually the table alias is derived from the wrq-table alias with which this bindingItem is referenced b.country will be taken from the table that is associated with the wrq table alias "b" This value is created during each query. But here are two special cases: tableAliasOverwrite allows to completely ignore this and fix out table alias by using setTableAliasOverwrite(). This is used for CTE fo example tableAliasPostFix will be not empty in case the BindingItem comes from a Relation as it mist be the Relation-joined (as opposed to Wrq-joined) table- Returns:
- Throws:
BindingNotFoundException
-
getParentWrsC
-
getCaption
- Specified by:
getCaption
in interfaceWrsBindingItem
-
getJDBCColumnScale
- Specified by:
getJDBCColumnScale
in interfaceWrsBindingItem
-
getBoundVariables
-
getSkipForTotals
-
getReferenceBindingItem
- Returns:
- a
BindingItem
this item is referencing, maybe null in case this is a virtual item
-
isNumeric
public boolean isNumeric()- Returns:
- true if the BindingItem represents a numeric value
-
getAttribute
-
setTableAliasOverwrite
-