简体   繁体   中英

JPA 1.0 or hibernate?

We are planning to migrate to Java EE 5 from j2EE 1.4. All of our ORM needs were fulfilled well by Hibernate 2.1.0 s0 far. Since we are moving to Java EE 5 which has support for JPA 1.0, I am wondering if it is worth to move all of my ORM stuff to JPA.

Are there any gotchas I should be concerned about? Are there places where JAP 1.0 wouldnt work?

I don't want to use JPA 2.0.

The JPA 1.0 API has some pretty glaring holes in it (eg lack of custom value types, no collections-of-elements). Porting an application from the native Hibernate API to the JPA 1.0 API can be painful due to this lack of basic functionality.

However, Hibernate's Annotations API is an extension of the basic JPA API, so you use JPA as far as it goes, and top it off with Hibernate extensions. The annotations style is the easiest way to use Hibernate now, so this is the nicest compromise.

If you already have a working Hibernate application, though, I have to wonder if it's worth the bother. I'd be tempted to leave it as it is, it should work just fine in a Java EE 5 environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM