Class LogicalUnion

  • All Implemented Interfaces:
    SelectExecutor, Union

    public class LogicalUnion
    extends java.lang.Object
    implements Union
    A logical union made up of multiple distinct selects whose results are combined in memory.
    Author:
    Abe White
    • Constructor Detail

      • LogicalUnion

        public LogicalUnion​(JDBCConfiguration conf,
                            int sels)
        Constructor.
        Parameters:
        conf - system configuration
        sels - the number of SQL selects to union together
      • LogicalUnion

        public LogicalUnion​(JDBCConfiguration conf,
                            Select[] seeds)
        Constructor used to seed the internal selects.
      • LogicalUnion

        protected LogicalUnion​(JDBCConfiguration conf,
                               int sels,
                               Select[] seeds)
        Delegate constructor.
    • Method Detail

      • getSelects

        public Select[] getSelects()
        Description copied from interface: Union
        Return the selects that make up this union.
        Specified by:
        getSelects in interface Union
      • isUnion

        public boolean isUnion()
        Description copied from interface: Union
        Whether this is a true UNION, rather than a logical combination of independent selects.
        Specified by:
        isUnion in interface Union
      • abortUnion

        public void abortUnion()
        Description copied from interface: Union
        Force the use of a series of standard selects rather than a true UNION.
        Specified by:
        abortUnion in interface Union
      • getOrdering

        public java.lang.String getOrdering()
        Description copied from interface: Union
        Get the union-level ordering, if any.
        Specified by:
        getOrdering in interface Union
      • getAutoDistinct

        public boolean getAutoDistinct()
        Description copied from interface: SelectExecutor
        Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.
        Specified by:
        getAutoDistinct in interface SelectExecutor
      • setAutoDistinct

        public void setAutoDistinct​(boolean distinct)
        Description copied from interface: SelectExecutor
        Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.
        Specified by:
        setAutoDistinct in interface SelectExecutor
      • isDistinct

        public boolean isDistinct()
        Description copied from interface: SelectExecutor
        Whether this is a SELECT DISTINCT / UNION ALL.
        Specified by:
        isDistinct in interface SelectExecutor
      • setDistinct

        public void setDistinct​(boolean distinct)
        Description copied from interface: SelectExecutor
        Whether this is a SELECT DISTINCT / UNION ALL.
        Specified by:
        setDistinct in interface SelectExecutor
      • isLRS

        public boolean isLRS()
        Description copied from interface: SelectExecutor
        Whether the result of this select should be treated as a large result set.
        Specified by:
        isLRS in interface SelectExecutor
      • setLRS

        public void setLRS​(boolean lrs)
        Description copied from interface: SelectExecutor
        Whether the result of this select should be treated as a large result set.
        Specified by:
        setLRS in interface SelectExecutor
      • setExpectedResultCount

        public void setExpectedResultCount​(int expectedResultCount,
                                           boolean force)
        Description copied from interface: SelectExecutor
        The expected result count for the query.
        Specified by:
        setExpectedResultCount in interface SelectExecutor
        force - if false, the count will be discarded if this select has any to-many eager joins that would throw off the result count
      • supportsRandomAccess

        public boolean supportsRandomAccess​(boolean forUpdate)
        Description copied from interface: SelectExecutor
        Return whether this select can support a random access result set type.
        Specified by:
        supportsRandomAccess in interface SelectExecutor
      • hasMultipleSelects

        public boolean hasMultipleSelects()
        Description copied from interface: SelectExecutor
        Affirm if this receiver requires more than one selects to fetch its data.
        Specified by:
        hasMultipleSelects in interface SelectExecutor
      • getCount

        public int getCount​(JDBCStore store)
                     throws java.sql.SQLException
        Description copied from interface: SelectExecutor
        Return the number of instances matching this select.
        Specified by:
        getCount in interface SelectExecutor
        Throws:
        java.sql.SQLException
      • select

        public void select​(Union.Selector selector)
        Description copied from interface: Union
        Select data using the given selector.
        Specified by:
        select in interface Union
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object