开发者

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 t开发者_如何学Pythono 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 (e.g. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜