Details
Description
I'm using Spring to configure Hibernate in my project. I'm getting pretty tired of duplicating parts of the configuration into a hibernate.cfg.xml that's used only for running the hbm2ddl goal.
So far it's just been a list of annotated classes which isn't too bad, but now I'm starting to use custom UserType classes.
Attached is a small and simple patch:
- Add dependency on spring-hibernate3
- Add SpringComponentConfiguration class to configure a Spring bean factory and get a Hibernate Configuration from it.
- Extend unit tests to exercise SpringComponentConfiguration.
- List new configuration component in the components page on the web site, for the hbm2ddl and hbm2java goals.
The SpringComponentConfiguration only supports the hbm2ddl and hbm2java goals and I don't really see this changing without a lot of work.
Thanks for the patch. The problem I see is that only works for configuration. For other type of configurations wouldn't work, so I wrote an example that shows how the integration can work. You can see it here: http://svn.codehaus.org/mojo/trunk/sandbox/hibernate3-maven-plugin/src/it/mhibernate-65/