I have a web application that read an argument from tomcat -D option and decide which property file should be used. So, How can I set below property in hibernate xml? Here What I want to do:
run tomcat with -Doption=xOption
Singleton Config class load xOption.properties
<hibernate-configuration>
<property name="hibernate.connection.url">Config.getinstance().getValue("dbUrl")</property>
</hibernate-configuration>
I get used to do it with using hibernate java config. Is there anyway to do it in xml file?