Until recently, I've always used the XML mapping files to define my persistence model with Hibernate. I was not real keen on the idea of using meta to define persistence in the objects themselves via annotations. However, I decided to give it a shot recently. My main argument had always been that by using the XML mapping, my persistent objects are not tied to Hibernate, exclusively. When I stopped to think about it though, one thought really hit me hard: I don't use any other ORM for my Java code. Why would it matter if the meta for mappings is in the code?
This being said, I wanted to pose a question: Is there a benefit to using annotations over XML mapping (other than JVM compatibility)? Your thoughts in the comments, please.























7 responses so far ↓
1 Sean Corfield // Aug 15, 2008 at 6:47 PM
2 Andy Powell // Aug 15, 2008 at 10:40 PM
3 Jason // Oct 19, 2008 at 12:51 AM
4 Rich Tretola // Nov 29, 2008 at 11:40 PM
5 Andy Powell // Dec 1, 2008 at 11:10 AM
6 Brad Bourne // Jan 29, 2009 at 4:09 PM
7 Louis Marascio // Mar 19, 2009 at 3:19 PM
Leave a Comment