Package de.businesscode.bcdui.wrs.load
Class WrqCalc2Sql
java.lang.Object
de.businesscode.bcdui.wrs.load.WrqCalc2Sql
Parses a Wrq and outputs SQL
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseOperator(Element e, StringBuffer sql) Append DatabaseCompatibility operatorInfo[3]protected static booleancontainsAggr(Element calc) Checks whether a wrq:Calc subtree contains any aggregationprotected StringgetWrqCalcAsSql(Element calc, List<Element> boundVariables, boolean enforceAggr, int dataType, List<String> wrqTableAlias) Returns a string representing the SQL and Lists with the binding variables and the wrq table aliases foundprotected voidopenOperator(Element e, StringBuffer sql) Append DatabaseCompatibility operatorInfo[1]
-
Field Details
-
wrqInfo
-
calc
-
boundVariables
-
calcFktMapping
-
aggregationMapping
-
-
Constructor Details
-
WrqCalc2Sql
Turns a wrq:Calc element into an SQL string- Parameters:
wrqInfo-
-
-
Method Details
-
getWrqCalcAsSql
protected String getWrqCalcAsSql(Element calc, List<Element> boundVariables, boolean enforceAggr, int dataType, List<String> wrqTableAlias) throws Exception Returns a string representing the SQL and Lists with the binding variables and the wrq table aliases found- Parameters:
calc- Is the wrq:Calc element to be parsed and converted to SQL.boundVariables- List will be filled with all constants found that should later be bound to the prepared statement. In SQL, they are represented as '?'enforceAggr- If true, we will enforce an aggregation even if the wrq:Calc contains no aggregation using @aggr or the default aggregationdataType- If it is numeric like Types.DECIMAL, we enforce an explicit cast for literal valueswrqTableAlias- List will be filled with all table aliases found in the wrq:Calc to be later translated into the SQL aliases- Throws:
Exception
-
containsAggr
Checks whether a wrq:Calc subtree contains any aggregation- Parameters:
calc-- Returns:
-
openOperator
Append DatabaseCompatibility operatorInfo[1]- Parameters:
e-sql-- Throws:
BindingNotFoundException
-
closeOperator
Append DatabaseCompatibility operatorInfo[3]- Parameters:
e-sql-- Throws:
BindingNotFoundException
-