Women in Technology

Hear us Roar



Article:
  Hibernate for Java SE
Subject:   No need to parse hibernate.cfg.xml
Date:   2005-11-22 13:13:18
From:   nikolai_t
org.hibernate.cfg.Configuration will happily do this for you even outside of container. You only need to include its location in the classpath. An obvious benefit is less configuration management code.


I have a separate build target which takes POJOs, mappings and some DAO classes and tests them outside of container. This takes a separate cfg.xml, but it reuses most of the settings of in-container one. I suspect there might be an ant task to build or modify it on the fly.


I agree that Hibernate documentation and literature is very container-centric. Learning curve is much easier if a student starts with a simple "Hello World" application which doesn't require setting up WebLogic or Tomcat..