This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Topic : comparing Hibernate with iBatis" Watch "Topic : comparing Hibernate with iBatis" New topic
Author

Topic : comparing Hibernate with iBatis

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

Hi all,

How does iBatis compare with Hibernate ?

Thanks,
Pradip


Groovy
Chris Richardson
author
Ranch Hand

Joined: Jan 10, 2006
Posts: 50
Pradip,

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: http://www.coderanch.com/t/216017/ORM/java/iBatis-Hibernate-same-book

I hope this helps.

Chris


Enterprise Java consulting and training - <a href="http://www.chrisrichardson.net" target="_blank" rel="nofollow">http://www.chrisrichardson.net</a> Author, POJOs in Action - <a href="http://www.manning.com/crichardson" target="_blank" rel="nofollow">http://www.manning.com/crichardson</a> Enterprise POJOs blog - <a href="http://chris-richardson.blog-city.com" target="_blank" rel="nofollow">http://chris-richardson.blog-city.com</a>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

Thanks chris
 
Consider Paul's rocket mass heater.
 
subject: Topic : comparing Hibernate with iBatis
 
Similar Threads
Great DAO replacement
Possible Category and New Forum Changes
Hibernate vs IBATIS
CodeFutures Ships New Release of FireStorm/DAO Java Code Generator
Tech Word Game