Forums Register Login
iBatis vs hibernate
Can someone point out which one is better ? why some people pick one over the other ?
iBATIS is very simple.
Hibernate is much more complex.

If you are a SQL expert and want to write SQL yourself, choose iBATIS.

But if you don't want to write SQL and you prefer more object-oriented query language and have much time to learn OR-mapping concepts and features, choose Hibernate.

iBATIS is so simple, it is just about XML, SQL, and plain-old objects, nothing more than that.

iBATIS is just a data mapper framework it maps fields in RDBMS tables to attributes in objects while Hibernate is an OR-mapping tool it maps objects to relational database.

Sounds similar, but OR-mapping is higher level than data mapping.
[ December 08, 2008: Message edited by: Kengkaj Sathianpantarit ]

Years ago I had to make a decision between the various ORM systems as to which one to implement. At that time rumor had it that EJB3 would use Hibernate as it's basic methodology (I know the politics behind the decision but that doesn't matter now). We were an EJB company so the decision was easy, Hibernate.

I would bet that more than just us made that decision for the same reason.

John G
The main difference between Hibernate and iBatis is that hibernate maps your objects to tables whereas iBatis maps your objects to SQL queries.

You can also consider the fact that even though HQL is great you can do much more with pure SQL, and it might even perform a great deal better with iBatis then Hibernate, as it allows you to take 100% control of the queries executed.
A few facts on iBatis vs Hibernate:
- you can actually override every single SQL statement Hibernate generates if you want to. So in essence, Hibernate does everything iBatis does. The description syntax is lighter on iBatis but you will probably not want to rewrite all Hibernate queries, so all in all the syntax overhead is probably easily overcome.
- Hibernate is much more than iBatis in the sense that it is a persistence context that guarantees a lot of things including object unicity, transparent object checking, first (and second) object level cache and many more things.

The philosophy is way different in the end. One focuses a lot of pure SQL and simple mapping, while Hibernate does focuses on mapping your domain model and managing object state changes for you whil providing you an object oriented query model (and let you back up to SQL if you need to). Also, no Hibernate has full-text search queries thanks to Hibernate Search
The only cure for that is hours of television radiation. And this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 11619 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 17, 2019 14:00:18.