Class WrqCalc2Sql

java.lang.Object
de.businesscode.bcdui.wrs.load.WrqCalc2Sql

public class WrqCalc2Sql extends Object
Parses a Wrq and outputs SQL
  • Field Details

  • Constructor Details

    • WrqCalc2Sql

      public WrqCalc2Sql(WrqInfo wrqInfo)
      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 aggregation
      dataType - If it is numeric like Types.DECIMAL, we enforce an explicit cast for literal values
      wrqTableAlias - List will be filled with all table aliases found in the wrq:Calc to be later translated into the SQL aliases
      Throws:
      Exception
    • containsAggr

      protected static boolean containsAggr(Element calc)
      Checks whether a wrq:Calc subtree contains any aggregation
      Parameters:
      calc -
      Returns:
    • openOperator

      protected void openOperator(Element e, StringBuffer sql) throws BindingNotFoundException
      Append DatabaseCompatibility operatorInfo[1]
      Parameters:
      e -
      sql -
      Throws:
      BindingNotFoundException
    • closeOperator

      protected void closeOperator(Element e, StringBuffer sql) throws BindingNotFoundException
      Append DatabaseCompatibility operatorInfo[3]
      Parameters:
      e -
      sql -
      Throws:
      BindingNotFoundException