Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dividing hibernate.cfg.xml into many files

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys:

Is there anyway of dividing the hibernate.cfg.xml into multiple files so that I may separate out the hibernate mapping configuration from the database access properties.
 
Nicolas Duran
Greenhorn
Posts: 1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure, but for your problem you can create an hibernate.properties files where you define all DB access (URL, user, pwd, dialect, etc) and then reference from the config file to those define values.
 
Justin Yao
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or you can use your new cfg xml like this


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic