views:

72

answers:

1

We are building a fairly database centric web application. We initially started off using iBatis.
At one point we thought iBatis may not be very useful for the following reasons:
1. Need for the appl. code to determine if we need to insert/update/delete from DB
2. Appl. code will deviate from being object oriented to being database oriented
3. Need to write a lot boiler plate code for many trivial things like entity versions(to avoid dirty DB updates)
and many more...
Now we are more than half way through after deciding to go with Hibernate. We are looking at real CONVINCING reasons to justify our choice of Hibernate over iBatis.

I understand iBatis and Hibernate are good frameworks that work well their own ways for different needs. Nevertheless we are trying to save our efforts by trying to justify our choice of Hibernate.

It would be of great help for us to hear from you experts. Please note we are strongly in favor of retaining Hibernate.

+1  A: 

Hibernate follows the JPA specification which allows you not directly dependent (vendor lock-in) on Hibernate. You can switch to a different implementation like TopLink if the need arises.

With Hibernate you can make your code 90% (or 100% if you don't use direct JDBC queries) database independent (using HQL) i.e., the same code will work on MSSQL, MySQL or Oracle (w/o any major changes made to the Data Access Layer).

Hibernate is very high per-formant with support for caching (both first level and second level).

Hibernate is a very good ORM (Object Relational Mapping) as compared to iBatis where you mostly end up hand coding different queries in XML and most of the time people using hibernate end up returning maps with data (due to overhead of configuring mapping from DB entities to Classes in Java) and hence end up with code where a single field deletion or addition causes major changes in the code.

Faisal Feroz
database independence does not really help in our case. We use a number of Oracles' non-standard features
One more point - You can have support for sharding (horizontal partitioning) seemlesly if you are using hibernate as compared to iBatis.
Faisal Feroz