Class SizeExpression

  • All Implemented Interfaces:
    Expression

    public final class SizeExpression
    extends AbstractSingleEncapsulatedExpression
    The SIZE function returns an integer value, the number of elements of the collection. If the collection is empty, the SIZE function evaluates to zero.
    BNF: expression ::= SIZE(collection_valued_path_expression)

    Version:
    2.5
    Author:
    Pascal Filion
    Since:
    2.3
    • Constructor Detail

      • SizeExpression

        public SizeExpression​(AbstractExpression parent)
        Creates a new SizeExpression.
        Parameters:
        parent - The parent of this expression
    • Method Detail

      • parse

        protected AbstractExpression parse​(WordParser wordParser,
                                           java.lang.String queryBNFId,
                                           boolean tolerant)
        Parses the given text by using the specified BNF.
        Overrides:
        parse in class AbstractExpression
        Parameters:
        wordParser - The text to parse based on the current position of the cursor
        queryBNFId - The unique identifier of the JPQLQueryBNF that is used to determine how to parse the text at the current cursor position within the JPQL query
        tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
        Returns:
        The Expression representing the given sub-query