How's that for a subject. So I am working on a new project where we are using JPA/Hibernate and Spring for transactional service junk and using JpaDaoSupport.
I want to completely decouple the database generation from the server startup process so I am using the
Ant hibernatetool task like so:
I have a Data Source defined in Spring using c3p0 but because the Ant task doesn't know about Spring I also have redundant info in the persistence.xml file. Is there a way to
a) tell the ant task to use a spring defined database (probably not would be my guess)
b) tell Spring to use the data source defined in the persistence.xml file
If the answer is possible with (b) then I have another question...
b.1) Is there a way to tell the persistence.xml file to use a properties file with the connection info rather than putting it directly in the xml file and if so (yes, another question) can you pull in an environment variable to use for the path?
For example, right now I am doing this in the applicationContext.xml file like so:
where
environment is an environment variable set when the server starts.