This is probably old news for anyone in the J2EE industry, but for me, it is kinda new. The more I work with Hibernate the more I become convinced of two things:
- If you have any form of application that is more than a few tables you have to use some form of Object-Relational Mapping (ORM) tool.
- If you are going to use an ORM tool, then use an existing one instead of creating your own.
These are actually two rules layed out by Rod Johnston in a talk he gave on what was wrong with J2EE. Two rules that I definitely agree with.
From my own experience, where I work, we created our own ORM tool for an application. It worked, but only sort of. It needed a lot of work to bring it up to the specs that was required. However, at the same time as developers were looking at improving our own ORM tool, we were also investigating Hibernate. The more we examined our ORM tool, the more we realized that we were just reinventing the wheel. Everything we needed to add, Hibernate already had.
In addition, in a few benchmark tests we did, Hibernate either beat what we implemented or did as well. And this is without all the added features that we needed in our own ORM app. This proved that Hibernate was the clear winner.
In the end, the choice came down to using a proven tool that was implemented in thousands of applications and had a huge user and developer community behind it or deploy something that had never been proven and was only moderately tested.
No surprise that we are now using Hibernate as our ORM tool.