May 20, 2024

I’ve been using Hibernate for O/R mapping about the past year. Though it’s quite powerful and in some ways makes things easier to code, I’ve come to the conclusion that I don’t like O/R mapping tools.

Reasons I don’t like Hibernate:
– You can’t test SQL statements until runtime. I’d much rather create a SQL statement and test it, then integrate it into the code. With Hibernate, you code it, deploy it, then see if it works or not.
– You have to learn a completely new syntax (HQL) to do complicated queries. It sort of defeats the point of not having to even write SQL. Even worse, you have to learn a new language that is proprietary. I’d rather stick with SQL that is a standard.
– There is no check of the XML configurations to see if it’s valid while writing it.
– Using XDoclet with Hibernate makes XML generation easy, but it does not support composite primary keys.
– Using XDoclet requires regeneration of all the mapped objects, even if I only change one object. This is a nuisance when you have a lot of mapped objects.
– Cannot do a mass update/delete. You have to update or delete each object individually.