Support for entity type expression in JPA2 has been committed under svn r736881.
Open issues & limitations:
1. OpenJPA does now allow selection of an abstract entity, hence
TYPE(e) if e is mapped to abstract entity class will fail as a user error.
For example, in using entities defined in org.apache.openjpa.persistence.inheritance.polymorphic package under openjpa-persistence-jdbc test
the following query results in exception:
SELECT t.translatable FROM Translation t
<openjpa-2.0.0-SNAPSHOT-runknown nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Cannot instantiate virtual mapping "class org.apache.openjpa.persistence.inheritance.polymorphic.Translatable".
for the same reason, the query below fails in the same error:
SELECT TYPE(t.translatable) FROM Translation t
2. No tests have been run for entities using JAVA interface classes.
Do we need to support TYPE(e) where e is referencing JAVA interface class which does have backing entity implementation classes ?
This is not being addressed in JPA2 Public Draft.