Monday, February 23, 2009

iBATIS, Hibernate, and JPA - Which one ?

iBATIS, Hibernate, and JPA are three different mechanisms for persisting data in a relational database, each one with its own advantages and limitations.

Before we delve into which one - lets think back on our criteria of choosing. Is it that you require complete control over SQL for your application, do you need to auto-generate SQL, or just want an easy-to-program complete ORM solution.

iBATIS does not provide a complete ORM solution, and does not provide any direct mapping of objects and relational models. However, iBATIS provides you with complete control over queries.
Hibernate provides a complete ORM solution, but offers you no control over the queries. Hibernate is very popular and a large and active community provides support for new users.

JPA also provides a complete ORM solution, and provides support for object-oriented programming features like inheritance and polymorphism, but its performance depends on the persistence provider.

A much more detailed analysis is always most welcome.

No comments: