Issue Details (XML | Word | Printable)

Key: GLASSFISH-481
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: jielin
Reporter: tware
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

add query hint to disable jpql validation

Created: 27/Mar/06 06:30 AM   Updated: 06/Mar/12 09:56 PM
Component/s: entity-persistence
Affects Version/s: 9.0pe
Fix Version/s: not determined

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 481
Tags:
Participants: jielin, marina vatkina, Tom Mueller and tware


 Description  « Hide

There are some restrictions to jpql in the EJB 3.0 persistence specification
for the query language that disallow some things that will work on some
databases. As a result, JPQL validation will disallow writing queries that
could provide correct results on certain databases.

An example is: IN

From the spec:

in_expression ::=
state_field_path_expression [NOT] IN ( in_item {, in_item}* | subquery)
in_item ::= literal | input_parameter
The state_field_path_expression must have a string, numeric, or enum value

On an Oracle database IN can be used with Dates. With a hint to disable
validation, it would be possible to write a JPQL query that would correctly
return values that used an IN with a Date.