Class ResolverBuilder

  • All Implemented Interfaces:
    ExpressionVisitor
    Direct Known Subclasses:
    DefaultResolverBuilder, EclipseLinkResolverBuilder

    public abstract class ResolverBuilder
    extends java.lang.Object
    implements ExpressionVisitor
    This visitor creates a Resolver that gives information about the visited Expression. The actual Resolver will calculate the proper IType as well.

    The type of an Expression follows the following rules:

    • The type of the query result specified by the SELECT clause of a query is an entity abstract schema type, a state field type, the result of a scalar expression, the result of an aggregate function, the result of a construction operation, or some sequence of these.
    • The result type of the SELECT clause is defined by the result types of the select expressions contained in it. When multiple select expressions are used in the SELECT clause, the elements in this result correspond in order to the order of their specification in the SELECT clause and in type to the result types of each of the select expressions.
    • The result type of an identification_variable is the type of the entity object or embeddable object to which the identification variable corresponds. The type of an identification_variable that refers to an entity abstract schema type is the type of the entity to which that identification variable corresponds or a subtype as determined by the object/relational mapping.
    • The result type of a single_valued_path_expression that is a state_field_path_expression is the same type as the corresponding state field of the entity or embeddable class. If the state field of the entity is a primitive type, the result type is the corresponding object type.
    • The result type of a single_valued_path_expression that is a single_valued_object_path_expression is the type of the entity object or embeddable object to which the path expression corresponds. A single_valued_object_path_expression that results in an entity object will result in an entity of the type of the relationship field or the subtype of the relationship field of the entity object as determined by the object/relational mapping.
    • The result type of a single_valued_path_expression that is an identification_variable to which the KEY or VALUE function has been applied is determined by the type of the map key or value respectively, as defined by the above rules.
    • The result type of a single_valued_path_expression that is an identification_variable to which the ENTRY function has been applied is Map.Entry, where the key and value types of the map entry are determined by the above rules as applied to the map key and map value respectively.
    • The result type of a scalar_expression is the type of the scalar value to which the expression evaluates.
    • The result type of an entity_type_expression scalar expression is the Java class to which the resulting abstract schema type corresponds.
    • The result type of a constructor_expression is the type of the class for which the constructor is defined. The types of the arguments to the constructor are defined by the above rules.

    Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

    Version:
    2.5.1
    Author:
    Pascal Filion
    Since:
    2.3