Maven 2.x Hibernate Plugin

Add a configuration component to use Spring

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: 3.0
  • Component/s: hbm2ddl, hbm2java
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

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.

Activity

Hide
Johann Reyes added a comment -

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/

Show
Johann Reyes added a comment - 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/

People

Vote (5)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: