This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate or iBatis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate or iBatis" Watch "Hibernate or iBatis" New topic
Author

Hibernate or iBatis

David Feitosa
Greenhorn

Joined: Sep 08, 2003
Posts: 3
I start to learn Spring, and it has support to Hibernate and iBatis. Who is the best to work? I never see iBatis before. Anybody knows any article that do an comparison? thanks.
Dave Trussell
Greenhorn

Joined: Sep 03, 2003
Posts: 3
Originally posted by David Feitosa:
Anybody knows any article that do an comparison?


Comparison:
http://c2.com/cgi-bin/wiki?ObjectRelationalToolComparison
Christian Bauer
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 45
They are different and each can be useful, depending on your architecture and/or process.

iBatis is a lightweight mapper, you have full control over all SQL executed (you have to write it yourself) which is very helpful in situations with lots of stored procedures and business logic already existant in the database system. iBatis maps result sets to object graphs and offers some abstraction of the underlying/externalized SQL.

Hibernate is a "full" object/relational mapping tool that is most efficient if used with business logic/domain models in the Java application tier and a normal entity-driven (and hopefully sensible) data model in a SQL database. Hibernate then automates any persistence operations (loading, saving, querying for objects, etc.) for you and offers many interesting optimizations (caching, lazy loading, eager fetching, batch fetching) which are difficult to achieve in a hand-written persistence layer. I'd say it is a bit harder to use Hibernate with very old/broken legacy database schemas but that changes now with Hibernate3, which also offers you to completely hand-craft the SQL that is executed while still giving you many features that make your work easier.


Co-Author of <a href="http://www.manning.com/bauer" target="_blank" rel="nofollow">Hibernate in Action</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Dave Trussell:


Comparison:
http://c2.com/cgi-bin/wiki?ObjectRelationalToolComparison


Oh.. It's good link.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
iBatis is a lightweight mapper, you have full control over all SQL executed (you have to write it yourself) which is very helpful in situations with lots of stored procedures and business logic already existant in the database system. iBatis maps result sets to object graphs and offers some abstraction of the underlying/externalized SQL.


iBatis can call store procedure or can create store procedure in mapping file like as Hibernate ??
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
If you have access to the JDBC from iBatis than indeed you will be able to call stored procedures.

As for creating stored procedures from mapping files in Hibernate, I know nothing about this... is it really possible?

./pope


blog - InfoQ.com
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
Yes, it is possibe in Hibernate3.


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/193239415X/ref=jranch-20" target="_blank" rel="nofollow">Hibernate in Action</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Gavin King:
Yes, it is possibe in Hibernate3.


OK, Ready to Hibernate 3.0 but now it's alpha version...

When Hibernate3 will final release ?
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
We are not completely sure yet, but we will have a beta very soon.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
You never have enough of Hibernate Gavin, ain't you? Me tooooo :-).

./pope
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate or iBatis