Hi,
I need to write ant tasks to generate DDL for two different databases (Oracle for production, hsqldb for unit testing). I have two different properties files with the respective database connection info (hibernate-oracle.properties and hibernate-hsqldb.properties), but I'm using jpaconfiguration so there doesn't seem to be any way to tell Hibernate which .properties file to use. The only reason I am using jpaconfiguration is to get the auto-scanning for annotated classes.
I'm new to Hibernate, but the only solutions I can think of are:
1- Put each .properties file in a different directory and manipulate the htools classpath so that Hibernate only finds the .properties I want to use (seems like an ugly hack)
2- Use annotationconfiguration instead of jpaconfiguration and manually specify (in hibernate.cfg.xml) all of my Entity classes (yuk).
Is there some other way to tell Hibernate which hibernate.properties to use (or some other way to specify the hibernate.connection and hibernate.dialect properties) when using jpaconfiguration?
Thanks,
Todd Klaus
Kepler Space Telescope
http://kepler.nasa.gov