Class UnionQueryImpl

  • All Implemented Interfaces:
    Query

    public class UnionQueryImpl
    extends Object
    implements Query
    Represents a union query.
    • Method Detail

      • setLimit

        public void setLimit​(long limit)
        Specified by:
        setLimit in interface Query
      • setOffset

        public void setOffset​(long offset)
        Specified by:
        setOffset in interface Query
      • setTraversalEnabled

        public void setTraversalEnabled​(boolean traversal)
        Specified by:
        setTraversalEnabled in interface Query
      • setQueryOptions

        public void setQueryOptions​(QueryOptions options)
        Description copied from interface: Query
        Set the query option to be used for this query.
        Specified by:
        setQueryOptions in interface Query
        Parameters:
        options - the options
      • prepare

        public void prepare()
        Description copied from interface: Query
        Prepare the query. The cost is estimated and the execution plan is decided here.
        Specified by:
        prepare in interface Query
      • getEstimatedCost

        public double getEstimatedCost()
        Description copied from interface: Query
        Get the estimated cost.
        Specified by:
        getEstimatedCost in interface Query
        Returns:
        the estimated cost
      • getSize

        public long getSize()
        Description copied from interface: Query
        Get the size if known.
        Specified by:
        getSize in interface Query
        Returns:
        the size, or -1 if unknown
      • getSize

        public long getSize​(Result.SizePrecision precision,
                            long max)
        Description copied from interface: Query
        Get the size if known.
        Specified by:
        getSize in interface Query
        Parameters:
        precision - the required precision
        max - the maximum nodes read (for an exact size)
        Returns:
        the size, or -1 if unknown
      • setExplain

        public void setExplain​(boolean explain)
        Specified by:
        setExplain in interface Query
      • setMeasure

        public void setMeasure​(boolean measure)
        Specified by:
        setMeasure in interface Query
      • init

        public void init()
        Description copied from interface: Query
        Initialize the query. This will 'wire' selectors into constraints, and collect bind variable names. It will also simplify expressions if possible, but will not prepare the query.
        Specified by:
        init in interface Query
      • getPlan

        public String getPlan()
        Description copied from interface: Query
        Get the query plan. The query must already be prepared.
        Specified by:
        getPlan in interface Query
        Returns:
        the query plan
      • getIndexCostInfo

        public String getIndexCostInfo()
        Description copied from interface: Query
        Get the index cost as a JSON string. The query must already be prepared.
        Specified by:
        getIndexCostInfo in interface Query
        Returns:
        the index cost
      • setInternal

        public void setInternal​(boolean isInternal)
        Specified by:
        setInternal in interface Query
      • isSortedByIndex

        public boolean isSortedByIndex()
        Description copied from interface: Query
        Returns whether the results will be sorted by index. The query must already be prepared.
        Specified by:
        isSortedByIndex in interface Query
        Returns:
        if sorted by index
      • buildAlternativeQuery

        public Query buildAlternativeQuery()
        Description copied from interface: Query
        Try to convert the query to an alternative form, specially a "union". To avoid any potential error due to state variables perform the conversion before the Query.init().
        Specified by:
        buildAlternativeQuery in interface Query
        Returns:
        this if no conversions are possible or a new instance of a Query. Cannot return null.
      • copyOf

        public Query copyOf()
                     throws IllegalStateException
        Description copied from interface: Query

        returns a clone of the current object. Will throw an exception in case it's invoked in a non appropriate moment. For example the default QueryImpl cannot be cloned once the Query.init() has been executed.

        May return null if not implemented.

        Specified by:
        copyOf in interface Query
        Returns:
        a clone of self
        Throws:
        IllegalStateException
      • isInit

        public boolean isInit()
        Specified by:
        isInit in interface Query
        Returns:
        true if the query has been already initialised. false otherwise.
      • getStatement

        public String getStatement()
        Specified by:
        getStatement in interface Query
        Returns:
        the original statement as it was used to construct the object. If not provided the toString() will be used instead.
      • isInternal

        public boolean isInternal()
        Specified by:
        isInternal in interface Query
        Returns:
        true if the current query is internal. false otherwise.
      • containsUnfilteredFullTextCondition

        public boolean containsUnfilteredFullTextCondition()
        Description copied from interface: Query
        Whether the condition contains a fulltext condition that can not be applied to the filter, for example because it is part of an "or" condition of the form "where a=1 or contains(., 'x')".
        Specified by:
        containsUnfilteredFullTextCondition in interface Query
        Returns:
        true if yes
      • isPotentiallySlow

        public boolean isPotentiallySlow()
        Description copied from interface: Query
        Whether the query is potentially slow. Only supported for prepared queries.
        Specified by:
        isPotentiallySlow in interface Query
        Returns:
        true if traversal is the only option
      • verifyNotPotentiallySlow

        public void verifyNotPotentiallySlow()
        Description copied from interface: Query
        Verify the query is not potentially slow. Only supported for prepared queries.
        Specified by:
        verifyNotPotentiallySlow in interface Query
      • getChildren

        public Query[] getChildren()