File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Topic : comparing Hibernate with iBatis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Topic : comparing Hibernate with iBatis" Watch "Topic : comparing Hibernate with iBatis" New topic

Topic : comparing Hibernate with iBatis

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Hi all,

How does iBatis compare with Hibernate ?


Chris Richardson
Ranch Hand

Joined: Jan 10, 2006
Posts: 50

Hibernate and iBATIS are quite different. With ORM frameworks such as Hibernate you specify how your domain model maps to the database schema: classes to tables, fields to columns, and relationships to either foreign keys or join tables. The ORM framework then generates and executes SQL statements as your application manipulates objects. An ORM will keep track of which objects you have modified and automatically update the database.

With iBATIS you specify how JavaBeans properties map to prepared statement placeholders and how a ResultSet maps to JavaBeans. You write the SQL and iBATIS takes care of the tedious job of executing them. You are responsible for tracking which objects have been modified and telling iBATIS to save them.

Roughly speaking, accessing the database with iBATIS requires more programming and maintenance effort. However, you can use iBATIS in situations where it does not make sense to use an ORM framework. See my post about when to use ORM and when to use iBATIS:

I hope this helps.


Enterprise Java consulting and training - <a href="" target="_blank" rel="nofollow"></a> Author, POJOs in Action - <a href="" target="_blank" rel="nofollow"></a> Enterprise POJOs blog - <a href="" target="_blank" rel="nofollow"></a>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Thanks chris
I agree. Here's the link:
subject: Topic : comparing Hibernate with iBatis
It's not a secret anymore!