Class WrqCalc2Sql


  • public class WrqCalc2Sql
    extends java.lang.Object
    Parses a Wrq and outputs SQL
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.String> aggregationMapping  
      protected java.util.List<org.w3c.dom.Element> boundVariables  
      protected org.w3c.dom.Element calc  
      protected java.util.Map<java.lang.String,​java.lang.String[]> calcFktMapping  
      protected WrqInfo wrqInfo  
    • Constructor Summary

      Constructors 
      Constructor Description
      WrqCalc2Sql​(WrqInfo wrqInfo)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void closeOperator​(org.w3c.dom.Element e, java.lang.StringBuffer sql)  
      protected static boolean containsAggr​(org.w3c.dom.Element calc)  
      protected java.lang.String getWrqCalcAsSql​(org.w3c.dom.Element calc, java.util.List<org.w3c.dom.Element> boundVariables, boolean enforceAggr, int dataType)
      Returns a list of strings representing parts of SQL All uneven pos (including first) belong to the aggregation level an all even pos give one un-aggregated sql calc Sample 1: SUM(t38.f_k01)+AVG(t38.f_k01*3) |1 | 2 | 3 | 4 | 5 Sample 2: SUM(SUM(t38.f_k01*t38.f_k01)) OVER (PARTITION BY orig_ctr) | 1 | 2 | 3 | 4 |
      protected void openOperator​(org.w3c.dom.Element e, java.lang.StringBuffer sql)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • wrqInfo

        protected WrqInfo wrqInfo
      • calc

        protected org.w3c.dom.Element calc
      • boundVariables

        protected java.util.List<org.w3c.dom.Element> boundVariables
      • calcFktMapping

        protected final java.util.Map<java.lang.String,​java.lang.String[]> calcFktMapping
      • aggregationMapping

        protected final java.util.Map<java.lang.String,​java.lang.String> aggregationMapping
    • Constructor Detail

      • WrqCalc2Sql

        public WrqCalc2Sql​(WrqInfo wrqInfo)
    • Method Detail

      • getWrqCalcAsSql

        protected java.lang.String getWrqCalcAsSql​(org.w3c.dom.Element calc,
                                                   java.util.List<org.w3c.dom.Element> boundVariables,
                                                   boolean enforceAggr,
                                                   int dataType)
                                            throws java.lang.Exception
        Returns a list of strings representing parts of SQL All uneven pos (including first) belong to the aggregation level an all even pos give one un-aggregated sql calc Sample 1: SUM(t38.f_k01)+AVG(t38.f_k01*3) |1 | 2 | 3 | 4 | 5 Sample 2: SUM(SUM(t38.f_k01*t38.f_k01)) OVER (PARTITION BY orig_ctr) | 1 | 2 | 3 | 4 |
        Throws:
        java.lang.Exception
      • containsAggr

        protected static boolean containsAggr​(org.w3c.dom.Element calc)