persistence
persistence copied to clipboard
some errors (?) in the JPQL grammar
While working on the Query spec, I ran into the following things:
state_valued_path_expression ::=
state_field_path_expression | *general_identification_variable*
How can an identification variable can't represent a basic value?
type_discriminator ::=
TYPE(general_identification_variable |
single_valued_object_path_expression |
*input_parameter*)
What was input_parameter doing there?
single_valued_path_expression ::=
qualified_identification_variable |
**TREAT(qualified_identification_variable AS subtype)** |
state_field_path_expression |
single_valued_object_path_expression
What could possibly have been the intention of allowing TREAT(ENTRY(...)), TREAT(KEY(...)), TREAT(VALUE(...)) there, in a location where TREAT() is not even allowed for a regular identification_variable.
I think these things are so clearly wrong that we might as well fix them here too.