Class TypeExpression

  • All Implemented Interfaces:
    Expression

    public final class TypeExpression
    extends AbstractSingleEncapsulatedExpression
    An entity type expression can be used to restrict query polymorphism. The TYPE operator returns the exact type of the argument.

    Part of JPA 2.0.

    BNF: type_discriminator ::= TYPE(identification_variable | single_valued_object_path_expression | input_parameter)

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

      • TypeExpression

        public TypeExpression​(AbstractExpression parent)
        Creates a new TypeExpression.
        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