Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

iBatis vs hibernate

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone point out which one is better ? why some people pick one over the other ?
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raj,

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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic