I would like to put a good word in for the dynamic-map entity mode. From the amount of content available on the web discussing this feature it seems to me that few people use it -- and it's still experimental. Dynamic maps have a very important role when using Hibernate from dynamic JVM languages. I work for a company that uses Clojure as its primary language in enterprise-class software solutions. We have come to rely extensively on Hibernate for a number of its great features, database portability being for us perhaps the most important.
It is a real pleasure to combine dynamic map entities with clojure maps. We can construct a complex, nested data structure using the Clojure map literal and save it to db, all in a single expression. Without dynamic maps, we would have to burden our projects with precompiled Java code and maintain that code as our data model evolves. This way, we only change the Hibernate mappings, which for us play the role of database schema definitions with no redundancies in other models.
So far we have had no performance issues with dynamic map entity mode, quite to the contrary. We have successfully used them even for batch inserts that require one query per record to determine whether it should be inserted. Even on my development laptop I get over a thousand records processed per second.
I hope this feature lives on and becomes a standard part of Hibernate. As the JVM world turns increasingly towards dynamic languages, it may yet gain some serious traction.
|