Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 6 years ago.
Improve this question
Can you please recommend me the ORM that meets requirements in the title?
The standard in the industry is Hibernate of course, but it's so great and I am not sure I can master it in days. Or can I?
It's preferred to configure it via annotations, not XML (writing XML by hand is quite boring, isn't it?).
Actually, all I need is just to conveniently issue CRUD queries. Probably, I could do with simple JDBC and classes, but project can eventually grow and that means even more tedious work should be done again and again. Don't want to do anything so boring as writing same CRUD again and again ;)
Fast means at least not times slower than others because it's going to power server, that will coordinate some distributed calculations and thousands of PCs are going to hit it per minute may be.
Simple-to-learn means simple first-step tutorial for it does not go over 5 pages of text and does not go into something like ObjectDispatcherizationStrategyMubleHuble every now and again ;)
I think simple CRUD is doable with Hibernate in days, except for the complexities introduced by 1:m and m:n relationships, lazy loading, open sessions for transactions, etc.
This assumes that you've got a solid object design to map to. If you don't, you're missing the "O" in ORM.
I think iBatis can be a nice intermediate step between JDBC and full-blown ORM. Check it out.
I'll vote for my ORMLite package which I designed to be a simple replacement for iBatis and Hibernate. It works with annotations and has a simple DAO class hierarchy. There is a bunch of documentation including HTML and PDF. Here's the section on how to get started.
And there are some working examples to get started with JDBC or Android OS:
Java Persistence API (JPA) is the 'official' Sun/Oracle ORM for Java. It's heavily based on Hibernate but with a more limited feature set, so I think that makes it easier to learn. It is also annotation based (there is usually just one XML file for the database connection).
There is more than one implementation of JPA: OpenJPA, EclipseLink and Hibernate are some well-known implementations; I use the Hibernate JPA implementation because I can then use Hibernate-specific extensions when JPA doesn't do what I want it to.
Also, the Sun JPA tutorial is exactly five pages :-)
http://download.oracle.com/javaee/6/tutorial/doc/bnbpz.html
MyBatis (formally known as iBATIS) is definitely a good alternative to Hibernate if you're looking for something lightweight that and easy to learn.
Take a look at persist - https://github.com/rufiao/persist .
MicroORM - very lightweight and effective.
I know what you mean about Hibernate. Hibernate does everything but can be a huge learning curve for someone who does not need everything. I authored an alternative for the situation that you describe: www.sormula.org. Simple learning curve, POJO-friendly, CRUD-ready out-of-the-box.
Here's a non-exhaustive selection of tools that simplify CRUD operations with POJOs:
JPA-based:
- Hibernate - This is where JPA was originally inspired from
- TopLink
- OpenJPA
- EclipseLink
Proprietary:
- jOOQ - This library provides a DSL for query construction in addition to CRUD support
- ActiveJDBC - This library is heavily inspired by Ruby's ActiveRecords
- Ebean - This library was well-known for being integrated in the Play Framework