Class SqlFromSubSelect


  • public class SqlFromSubSelect
    extends java.lang.Object
    Takes a single wrq:Select (formally a "sub-select") and turns it into a SQLStatementWithParams
    • Field Detail

      • selectElem

        protected final org.w3c.dom.Element selectElem
      • wrqInfo

        protected final WrqInfo wrqInfo
      • rowStart

        protected int rowStart
      • rowEnd

        protected int rowEnd
      • bindingSetForWrqAlias

        protected java.util.Map<java.lang.String,​WrqBindingSet> bindingSetForWrqAlias
      • aliasCounter

        protected int aliasCounter
      • wrqTransformRowLimitXsltStatic

        protected static java.lang.String wrqTransformRowLimitXsltStatic
    • Constructor Detail

      • SqlFromSubSelect

        public SqlFromSubSelect​(WrqQueryBuilder wrqQueryBuilder,
                                SqlFromSubSelect parent,
                                org.w3c.dom.Element selectElem)
                         throws java.lang.Exception
        We are initialized for a full-select (SELECTSs connected with SET operators).
        Parameters:
        wrqQueryBuilder -
        selectElem -
        Throws:
        java.lang.Exception
    • Method Detail

      • createSelectStatement

        protected void createSelectStatement()
                                      throws java.lang.Exception
        Handles a "select-statement", i.e. a complete select
        Throws:
        java.lang.Exception
        See Also:
        ISqlGenerator.getSelectStatement()
      • generateWhereClause

        protected void generateWhereClause​(WrqInfo wrqInfo,
                                           SQLStatementWithParams sqlStatement)
                                    throws java.lang.Exception
        Generates 'WHERE ' plus the filter
        Throws:
        javax.xml.xpath.XPathExpressionException
        BindingException
        java.lang.Exception
      • generateGroupingClause

        protected void generateGroupingClause​(WrqInfo wrqInfo,
                                              SQLStatementWithParams sqlStatement)
                                       throws java.lang.Exception
        Generates Grouping clause
        Throws:
        java.lang.Exception
      • generateHavingClause

        protected void generateHavingClause​(WrqInfo wrqInfo,
                                            SQLStatementWithParams sqlStatement)
                                     throws javax.xml.xpath.XPathExpressionException,
                                            BindingException
        Generates Having SQL clause
        Parameters:
        wrqInfo -
        sqlStatement -
        Throws:
        javax.xml.xpath.XPathExpressionException
        BindingException
      • getBoundVariables

        public java.util.List<org.w3c.dom.Element> getBoundVariables()
      • getSelectedBindingItems

        public java.util.LinkedList<WrsBindingItem> getSelectedBindingItems()
      • getRepresentingBindingSet

        public WrqBindingSet getRepresentingBindingSet()
                                                throws java.lang.Exception
        A BindingSet representing us as if we where a bnd:BindingSet
        Returns:
        Throws:
        java.lang.Exception
      • getWrqInfo

        public WrqInfo getWrqInfo()
      • getResolvedBindingSets

        public java.util.Set<StandardBindingSet> getResolvedBindingSets()
      • addBindingSetForWrqAlias

        public void addBindingSetForWrqAlias​(java.lang.String wrqAlias,
                                             WrqBindingSet bindingSet)
        Set the BindingSet for a user provided table expression alias
        Parameters:
        wrqAlias -
        bindingSet -
      • getWrqQueryBuilder

        public WrqQueryBuilder getWrqQueryBuilder()
        Access to the current overall query
        Returns:
      • getParent

        public SqlFromSubSelect getParent()
        Access to parent select, may be null This is the namespace for table aliases
        Returns:
      • getNextTableSqlAlias

        public java.lang.String getNextTableSqlAlias()
        Produce a new unique sql table alias for the current select scope
        Returns:
      • getSelectElem

        public org.w3c.dom.Element getSelectElem()