Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JPA Implementations - Which one is the best to use? [closed]

I have made use of the following JPA implementations:

  1. Hibernate,
  2. Toplink,
  3. OpenJPA

Each of them has their own strengths and weaknesses. I found Hibernate the most advanced of the three except that it mixed some of its own enhancements with JPA which made it difficult to switch out to other providers. Most importantly, its query parser was much more lenient when interpreting JPA. They make it slightly difficult to get the correct libraries to support hibernate because I found it a mission trying to get the right versions of all the dependencies.

Toplink was ok but one is left with the feeling that it is slightly crippled as it seems Oracle wants you to use/buy? their more advanced library. Trying to download it was also a mission because you need to install it via running a jar file. I found that it implemented only the base JPA spec. The reason I used it was hibernate uses a lot of libraries that are commonly used in other open source projects that one would often get classloarder problems, especially when using JBoss

OpenJPA - This has by far the best documentation and is easy to download and use but it seems its very buggy. Maybe its just my code but code I found more advanced usage such as OneToMany relationships with CascadeType.all set just didn't seem to work. Admittedly It may be my code that was wrong and I haven't had time to test a clean case but many incidents like this leave me scared to use it. I really hope it gets better. Its error messages are often useless in helping solve the problem.

What other libraries have people used and which ones do they prefer and why?

like image 262
mxc Avatar asked Feb 23 '09 06:02

mxc


People also ask

What are different JPA implementations?

JPA is a specification and several implementations are available. Popular implementations are Hibernate, EclipseLink and Apache OpenJPA. The reference implementation of JPA is EclipseLink. JPA permits the developer to work directly with objects rather than with SQL statements.

What are some well known JPA providers?

There are popular JPA implementations like Hibernate, Toplink and EclipseLink.


1 Answers

I had the same conclusions about these implementations.

  1. OpenJPA was/seemed buggy

  2. Hibernate had tons of libraries and seemed to have trouble with not lazy loading everything.

  3. Toplink ended up as my choice. It was not as flexible as Hibernate would have been but it works and I don't have to install commons-logging.

The one I would try next is JPOX, which has recently been renamed to datanucleus.

like image 83
Clint Avatar answered Sep 25 '22 00:09

Clint