*
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 Android Security Essentials Live Lessons this week in the Android 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: 8904

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: 8904

Thanks chris
 
Don't get me started about those stupid light bulbs.
 
subject: Topic : comparing Hibernate with iBatis
 
Similar Threads
Tech Word Game
Great DAO replacement
Possible Category and New Forum Changes
Hibernate vs IBATIS
CodeFutures Ships New Release of FireStorm/DAO Java Code Generator