Class WrqBindingSetFromTableReference

  • All Implemented Interfaces:
    BindingSet, WrqBindingSet, java.io.Serializable, java.lang.Cloneable

    public class WrqBindingSetFromTableReference
    extends WrqBindingSetVirtual
    Represents a virtual BindingSet resulting from the children of wrq:From, i.e. a table reference A table reference can be a plain table name or joined tables factors, i.e. table names, derived table expressions or references to CTE Mostly it deals with the handling of wrq:Join, but for consistency we also take care for cases without
    See Also:
    Serialized Form
    • Field Detail

      • importedBindingItems

        protected java.util.Map<java.lang.String,​BindingItem> importedBindingItems
      • isAllowSelectAllColumns

        protected boolean isAllowSelectAllColumns
      • joinTypes

        protected static final java.util.Map<java.lang.String,​java.lang.String> joinTypes
      • connectorsTypes

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

      • WrqBindingSetFromTableReference

        public WrqBindingSetFromTableReference​(org.w3c.dom.NodeList fromChildNl,
                                               SqlFromSubSelect currentSelect,
                                               java.util.Set<java.lang.String> allRawBRefs,
                                               boolean selectAll)
                                        throws java.lang.Exception
        Constructor
        Parameters:
        fromChildNl - - Children of wrq:From
        currentSelect - - Context
        allRawBRefs - - These bRefs we need at least. Important for BindingSetGroups
        selectAll - - If true, we do not know all required BindingItems, probably we have an empty select list, just add all
        Throws:
        java.lang.Exception
    • Method Detail

      • handleJoinCondition

        protected boolean handleJoinCondition​(org.w3c.dom.Element elem,
                                              java.lang.String connect,
                                              boolean isFirst)
                                       throws BindingNotFoundException
        Recursively handle join conditions
        Parameters:
        elem -
        connect -
        isFirst -
        Returns:
        Throws:
        BindingNotFoundException
      • firstWrqChildElem

        protected org.w3c.dom.Element firstWrqChildElem​(org.w3c.dom.Node elem)
        Find first wrq:* child
        Parameters:
        elem -
        Returns:
      • followingWrqElem

        protected org.w3c.dom.Element followingWrqElem​(org.w3c.dom.Node elem)
        Find next wrq:* sibling
        Parameters:
        elem -
        Returns:
      • addTableFactor

        protected void addTableFactor​(org.w3c.dom.Element teElem,
                                      SQLStatementWithParams sqlStatementWithParams,
                                      java.util.Set<java.lang.String> allRawBRefs,
                                      boolean selectAll)
                               throws java.lang.Exception
        Adds the BindingItems for a table factor to the virtual one we are creating
        Parameters:
        teElem -
        sqlStatementWithParams -
        allRawBRefs -
        selectAll -
        Throws:
        java.lang.Exception
      • collectBindingItems

        protected void collectBindingItems​(java.util.Set<java.lang.String> allRawBRefsWoRel,
                                           java.lang.String wrqAlias,
                                           boolean selectAll,
                                           BindingSet bs)
                                    throws BindingException
        Collect all BindingItems requested from the underlying (maybe virtual) BindingSet
        Parameters:
        allRawBRefsWoRel -
        wrqAlias -
        selectAll -
        bs -
        Throws:
        BindingException
      • getJdbcResourceName

        public java.lang.String getJdbcResourceName()
        Description copied from interface: BindingSet
        Gets the database name the table of the BindingSet is located in.
        Specified by:
        getJdbcResourceName in interface BindingSet
        Specified by:
        getJdbcResourceName in class WrqBindingSetVirtual
        Returns:
        All tables need to be on the same database, so here we return one from a random resolved BindingSet