I would like to have two hibernate config files, one pointing at the master db and the other at the slave. Rather than spell out all of the tables twice, I'd like to specify the tables in its own file and include it in both config files.
I've tried using entities
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
[ <!ENTITY targetfilename SYSTEM "targetfilename.xml"> ]>
<hibernate-configuration>
<session-factory>
&targetfilename;
</session-factory>
</hibernate-configuration>
and although it is able to create the reference, it is trying to resolve the filename in my apache bin dir:
/Users/me/Environment/apache-tomcat-6.0.35/bin/targetfilename.xml
That's not workable, because the path is different on my local machine vs on my prod environment. The included file is in the same dir as the main hibernate config file.
I tried using the ./ in front of the filename, e.g.,
Code:
[ <!ENTITY targetfilename SYSTEM "./targetfilename.xml"> ]
but that doesn't work either.
I've also tried to use xi:include, but it seems not to be compatible with the hibernate xml DTD, because I get the error Attribute "xmlns" must be declared for element type "hibernate-configuration".
I would welcome any useful ideas. Thanks!