dagblog.
← Archive

What persistence tool do you use?

Inspired by Is Hibernate the best choice?, I decided to run a small survey of my readers and the persistence frameworks they use.

I went from JDBC through iBatis to Hibernate, and I wouldn’t go back. You might object that Hibernate doesn’t suit every project, and you’d be right. But how many cases are like that, one or two in ten? First, a few words about JDBC and iBatis.

I don’t know how you’ve found the JDBC API, but I wouldn’t go back to it by choice. You need a helper for everything. If I had to use JDBC, it would be through a higher-level abstraction such as Spring’s. I like iBatis. What does it do? It maps SQL result sets to object graphs using XML. If you want a simple bridge from SQL to objects, it’s a good choice. If you need a full ORM tool, it starts to run out of steam. In its defense, it was never written as a replacement for ORM.

That brings me to ORM tools. I admit I have strong opinions: I divide them into Hibernate and everything else. Hibernate has plenty of flaws, but I can’t think of a comparable solution. I should say in what respects, so that someone can point out better options.

  • Legacy database schema support. See Database inheritance and ORM tools. Not every project can throw away its schema and redesign it to suit the ORM.
  • Community, documentation and support. For something as complex as ORM, you need all three.
  • Flexible mapping metadata. I don’t like annotations everywhere. I like them where they make metadata easier to express than XML, which isn’t always possible for ORM mappings.
  • Extensible APIs and add-ons. I want a framework I can extend where possible. In many apparently difficult cases, we found the right Hibernate interface and supplied an implementation. Sometimes you need something on top, like full-text search, and it’s handy to have it available already.

Is there a tool that beats Hibernate in at least one of these areas?

Medium version · Archived original page

Related articles

Related CZ Podcast episodes