java

Hibernate Configuration with No XML

Filed in archive Programming on November 27, 2005

BlogPicture


Click to enlarge
This is something I'm not sure everyone knows because I've searched a number of tutorials on the subject and not found anything. Additionally I'm not a big fan of XML configuration files unless they are absolutely required. Spring seems to be the exception to that rule for me since the drudgery involved in the XML configuration of it has such a large return on the time invested.

Anyway, Someone helped me with this the other day. I had been spending a lot of time getting my Hibernate configuration file working the way I wanted. After I finished an associate forwarded me a sample of some code they were working on and I thought it was pretty cool. I then rewrote my configuration file as properties in a Java class and like it with the hibernate configuration in a Java class. With this configuration and XDoclet there is no need to write any XML when using Hibernate at all.

I'm sure there are developers out there that like using XML instead but this is one more option. Changes would require a recompile... obviously. However, a change to an XML file would require an application to be restarted, which is much less severe but would affect the user experience as well. I guess it all depends on individual developers preferences and their like or dislike of XML configuration files.


Permalink: Hibernate Configuration with No XML

Tags: Hibernate  XML 

Vote for Hibernate Configuration with No XML:

  • Currently 4.40/10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
Rating: 4.40 out of 5 vote(s) cast.
 
Share It
RSSrss
Google google
Yahoo! yahoo
Addthis Subscribe using any feed reader!
Bloglines Bloglines
TwitterFollow us on Twitter!
Most Popular   AJAX   Application Development   Awards   Basics   Best of   Business   conference   Did you know   E-Commerce   Information About   Management   Misc   Mobile Devices   mobile phones   Monthly Contest   Personal   Programming   Quick introduction   Security   Service Oriented Architectures