-
Does it make sense to do the following instead?
Let it find the default hibernate.cfg.xml that can be anywhere on the classpath. My hibernate.cfg.xml resides in the cfg folder and cfg folder is on my classpath. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
jPOS-EE expects the template file That said, we'll think about an easy way to override it using a convention name (that could be I'm thinking along the lines of:
Would that work for you @chhil ? |
Beta Was this translation helpful? Give feedback.
jPOS-EE expects the template file
hibernate.cfg.xml
at the top of the classpath. In order to override the default with a customhibernate.cfg.xml
one needs to callDB db = new DB ("path/to/hibernate.cfg.xml")
or configureHIBERNATE_CFG
property (that can be done from code usingSystem.setProperty("HIBERNATE_CFG", "path/to/hibernate.cfg.xml")
once from your application.That said, we'll think about an easy way to override it using a convention name (that could be
cfg/hibernate.cfg.xml
)I'm thinking along the lines of:
cfg/hibernate.cfg.xml
in the filesystem and HIBERNATE_CFG environment variable is not present, we use that fileWould …