Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What Java ORM library implementing JPA that match following criteria would you recommend and why ?

  • free & open source
  • alive (at least bug fixes and a mailing list)
  • with good documentation
  • simple (simpler than hibernate)

I need to select a simple ORM tool that can be set up in minutes, without too much configuration and easy to understand, for setting simple CRUD DAOs. A query builder will be an interesting plus. Later I can have to move to Hibernate, that's why being JPA compliant is a must.

I have found some candidates on the web, but not so much feedback, so I will gladly take your advices on the topic.

----- EDIT ---------
I have been successfully testing ebean/avaje with a small test cases. Any one has a feedback on using these tools in production ?

share|improve this question
3  
Why not just use Hibernate from the beginning, if you might be switching eventually anyway? – Michael K Nov 16 '10 at 15:09
Because hibernate consumes a lot of time (learning, configuring, tuning, ...) and we only have some tables to map. Idea is to prepare the path, using a compliant JPA tool that is more lighweight than hibernate. – Guillaume Nov 19 '10 at 15:42
So, "simple" to you is a synonym for "not Hibernate"? – user1249 Nov 19 '10 at 17:44
:) Not exactly. But Hibernate is not so simple ! I'm looking for something simpler than hinernate. I have tested the avaje framework, and that is the kind of intermediate ORM tool I'm seaking. – Guillaume Dec 2 '10 at 12:47
If you use a recent version of Java, why not just use the JPA that comes with Java? There is a JAR file that ships with Java SE and it's part of the base package set in Java EE. Learning the quirks of JPA or Hibernate definitely takes some time, but the investment pays off. – GlenPeterson Sep 6 '12 at 13:38

5 Answers

up vote 2 down vote accepted

If you only have a small data model to worry about, why not use JDBC or a wrapper around it (e.g. Spring JDBC) to handle the boilerplate? That plus an active record architecture (objects know how to save/update themselves) on your model classes isn't that difficult to understand or maintain, and you're leaving your options very open for another tool down the road if you decide you need full ORM later.

share|improve this answer

I'm currently using JPA/hibernate/hsqldb(test), mysql(deployment). Not very difficult to do especially if you use maven to handle dependencies. Failing that (and you don't want to use hibernate) - you could try OpenJPA.

share|improve this answer

I am late with my response, but I have a tool for you: https://sourceforge.net/apps/trac/jooq/wiki/Manual

Unfortunately, you won't have JPA-compliance there. But if you're used to jOOQ, you don't want to "go JPA" anymore :-)

share|improve this answer

Apache Cayenne is the unsung hero. Really sad no one is talking about it.

The killer feature of Apache Cayenne is the CayenneModeler which it is a GUI tool for database reverse engineering and generation, as well as a Velocity-based class generation engine.

share|improve this answer

I'm happy using MyBatis. In the past they called their approach "query mapping" opposed to "object mapping" since MyBatis does map (complex) SQL queries on results. This is a different concept than ORM.

Today they say this about their project:

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.

"Data mapper" seems to be a more general term.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.