Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Topic : comparing Hibernate with iBatis

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How does iBatis compare with Hibernate ?

Thanks,
Pradip
 
Chris Richardson
author
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks chris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic