Issue Type: Bug Bug
Affects Versions: 4.1.8
Assignee: Unassigned
Attachments: jpa_type_test.zip
Created: 04/Nov/12 6:44 PM
Description:

The JPA 2 spec has a section about entity type expressions with some examples of how they can be used.

As of (I think) 4.0.0, Hibernate supports limited use of the TYPE() operator, but it's not sufficient to run some of the examples shown.

The biggest issue is that TYPE() cannot be used in the select clause, so there is no way to determine an entities class type as part of a query.

Another, smaller, issue is that the TYPE() operator doesn't seem to work if there is no inheritance hierarchy for the entities involved (minor problem, but it can be a trap when writing generic queries).

Attached test case (Maven project) which expects a DB named 'jpatypetest' running on localhost. It has a few simple test cases related to this, only one of which succeeds (TYPE() in where clause on polymorphic query).

Side note: is there a test case template project anywhere which uses the Hibernate infrastructure test classes talked about at the following link?
http://www.hibernate.org/issuetracker

Project: Hibernate ORM
Labels: query jpa2 type
Priority: Major Major
Reporter: Keith Phillips
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira