1

I've been working on using Hibernate to map my metamodel which isn't known at compile-time (see here) using EntityMode.MAP. I'd like to use the programmatic Criteria queries, but as of Hibernate 4 they say that the Hibernate Criteria query API is deprecated in favor of JPA. Fine.

But can I use JPA CriteriaQuery for non-classes? I don't see a way to specify entities by name instead of by class using "pure" JPA. Is there some Hibernate (non-standard JPA) trickery that enhances the JPA to support EntityMode.MAP?

Community
  • 1
  • 1
koehn
  • 744
  • 1
  • 8
  • 20
  • So by all appearances Hibernate cannot be used as is for EntityMode.MAP and JPA criteria queries. So I'm patching Hibernate. So far I can do single-table queries of concrete classes. All that's left are associations and superclass- and subclass-queries. As soon as its all done I'll push the patch to GitHub. – koehn Oct 04 '12 at 19:25
  • See here for changes so far: https://github.com/koehn/hibernate-orm/tree/4.1 – koehn Oct 04 '12 at 20:51

1 Answers1

1

This issue has been addressed in HHH-7714. You must use hibernate versions greater than 4.2.1 (Stable) / 4.3.0.Beta1(Unstable)

All possible credits to Koehn. Thank you for your contribution to the Hibernate Project!

Newbie
  • 7,031
  • 9
  • 60
  • 85