Class AbstractSelectClauseStateObject

    • Field Detail

      • DISTINCT_PROPERTY

        public static final java.lang.String DISTINCT_PROPERTY
        Notifies the distinct property has changed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractSelectClauseStateObject

        protected AbstractSelectClauseStateObject​(AbstractSelectStatementStateObject parent)
        Creates a new AbstractSelectClauseStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • hasDistinct

        public boolean hasDistinct()
        Gets whether the DISTINCT keyword is part of the query, which is used to return only distinct (different) values
      • hasSelectItem

        public abstract boolean hasSelectItem()
        Determines whether this SELECT clause has a select item defined (only one can be set for a subquery's SELECT clause and many for a top-level query).
        Returns:
        true if this state object has children; false otherwise
      • parse

        public abstract void parse​(java.lang.String jpqlFragment)
        Parses the given JPQL fragment and create the select item. For the top-level query, the fragment can contain several select items but for a subquery, it can represent only one.
        Parameters:
        jpqlFragment - The portion of the query representing one or several select items
      • setDistinct

        public void setDistinct​(boolean distinct)
        Sets whether the DISTINCT keyword should be part of the query, which is used to return only distinct (different) values
        Parameters:
        distinct - true to add DISTINCT to the query in order to have distinct values; false if it is not required
      • toggleDistinct

        public void toggleDistinct()
        Changes the state of the DISTINCT identifier; either adds it if it's not present or removes it if it's present.