The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

holger (1) [Avatar] Offline
#1
I think there are a lot of (older) projects which started with the native Hibernate API and native XML mappings.Now, it's the question of how to migrate to JPA 2.1 without pain.

What would be really useful is a Hibernate to JPA 2 migration guide both at the API, query and mapping level.
Does the book provide guidance for such a migration path?

For example, is it possible to use the native/proprietary Hibernate XML Mapping files with JPA 2 at the API level assuming Hibernate as persistence provider?

Will the book outline features of Hibernate that are not yet available in JPA? (custom collection types come to my mind)
Christian Bauer (56) [Avatar] Offline
#2
Re: book usable as migration guide?
> I think there are a lot of (older) projects which
> started with the native Hibernate API and native XML
> mappings.Now, it's the question of how to migrate to
> JPA 2.1 without pain.

That's what the previous edition was about, every native Hibernate operation and mapping was shown next to its JPA alternative. In this edition we cut all the native Hibernate mappings and operations if there is a JPA equivalent.

> For example, is it possible to use the
> native/proprietary Hibernate XML Mapping files with
> JPA 2 at the API level assuming Hibernate as
> persistence provider?

Of course, Hibernate is fully backwards compatible and the Java Persistence API is a wrapper of the Hibernate API. Every JPA interface has an unwrap() to access the native API.

> Will the book outline features of Hibernate that are
> not yet available in JPA? (custom collection types
> come to my mind)

Yes, no.