You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jonas Thurfors <jo...@gmail.com> on 2007/07/04 14:49:30 UTC
Generate DDL with Maven2, Spring2 and Hibernate3
I want to generate a DDL using Maven2, Spring2 and Hibernate3.
I would like to use the maven-hibernate3-plugin with the goal
hibernate3:hbm2ddl, but I don't use the hibernate.cfg.xml file,
instead I'm configuring Hibernate with Spring's
LocalSessionFactoryBean. How do I get the hibernate3 plugin to use my
configuration?
Kind Regards,
Jonas
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Generate DDL with Maven2, Spring2 and Hibernate3
Posted by animedj <an...@gmail.com>.
Hello sufyan
All depends on what is getting loaded. If it is annotated classes, yes, you
need a hibernate.cfg.xml
If it is hbm.xml and it's part of your current classpath, the plugin can
automatically loaded without the need to specify what classes.
Also you can define the datasource settings in the database.properties file
as specified here:
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/componentproperties.html
Regards
Johann reyes
On 7/6/07, Sufyan Arif <su...@gr-tech.net> wrote:
>
>
> Hi,
>
> We also have to duplicate the information in the hibernate.cfg.xml file in
> order to generate the ddl. I'd be interested to know how you manage to
> avoid
> having one? For e.g. how does the hibernate3-maven-plugin know which
> domain
> objects to generate the ddl for? Also where do you define the data source
> settings?
>
> thanks
> Sufyan
>
>
> On Friday 06 July 2007 13:37:15 animedj wrote:
> > Hello Jonas
> >
> > But if the classes that you need to load are in your classpath, it
> should
> > load it automatically and you shouldn't need a
> > hibernate.cfg.xmlconfiguration file. But recommended is to have one.
> >
> > Regards
> >
> > Johann Reyes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Generate DDL with Maven2, Spring2 and Hibernate3
Posted by Sufyan Arif <su...@gr-tech.net>.
Hi,
We also have to duplicate the information in the hibernate.cfg.xml file in
order to generate the ddl. I'd be interested to know how you manage to avoid
having one? For e.g. how does the hibernate3-maven-plugin know which domain
objects to generate the ddl for? Also where do you define the data source
settings?
thanks
Sufyan
On Friday 06 July 2007 13:37:15 animedj wrote:
> Hello Jonas
>
> But if the classes that you need to load are in your classpath, it should
> load it automatically and you shouldn't need a
> hibernate.cfg.xmlconfiguration file. But recommended is to have one.
>
> Regards
>
> Johann Reyes
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Generate DDL with Maven2, Spring2 and Hibernate3
Posted by animedj <an...@gmail.com>.
Hello Jonas
But if the classes that you need to load are in your classpath, it should
load it automatically and you shouldn't need a
hibernate.cfg.xmlconfiguration file. But recommended is to have one.
Regards
Johann Reyes
On 7/4/07, David J. M. Karlsen <da...@davidkarlsen.com> wrote:
>
> Jonas Thurfors wrote:
> > I want to generate a DDL using Maven2, Spring2 and Hibernate3.
> >
> > I would like to use the maven-hibernate3-plugin with the goal
> > hibernate3:hbm2ddl, but I don't use the hibernate.cfg.xml file,
> > instead I'm configuring Hibernate with Spring's
> > LocalSessionFactoryBean. How do I get the hibernate3 plugin to use my
> > configuration?
> unfortunately you have to configure it twice - or "refactor" out your
> settings to hibernate.cfg.xml and point the spring configured
> localsession... to it.
>
> --
> David J. M. Karlsen - +47 90 68 22 43
> http://www.davidkarlsen.com
> http://mp3.davidkarlsen.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Generate DDL with Maven2, Spring2 and Hibernate3
Posted by "David J. M. Karlsen" <da...@davidkarlsen.com>.
Jonas Thurfors wrote:
> I want to generate a DDL using Maven2, Spring2 and Hibernate3.
>
> I would like to use the maven-hibernate3-plugin with the goal
> hibernate3:hbm2ddl, but I don't use the hibernate.cfg.xml file,
> instead I'm configuring Hibernate with Spring's
> LocalSessionFactoryBean. How do I get the hibernate3 plugin to use my
> configuration?
unfortunately you have to configure it twice - or "refactor" out your
settings to hibernate.cfg.xml and point the spring configured
localsession... to it.
--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org