You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aleksei Valikov <va...@gmx.net> on 2006/10/27 11:32:23 UTC
Generating SQL to initialize database
Hi folks.
I wonder, what is the usual approach to generate or include in distribution or
package the SQL that sets up the database (DDL)?
For instance, I use Hyperjaxb to generate source code and Hibernate mappings
from the database schema. Based on the Hibernate mappings I can generate the DDL
that defines the database (there's a plugin to do that).
What I completely miss is how this SQL should be packaged or distributed and so
on. With HBMs everything works very nice - they are just packaged as resources
in the JAR (together with Hibernate configuration). Currently I simply use the
automatic schema creation of Hibernate. That is, during the start-up the
Hibernate automatically exports the database schema into the database. But what
should I do in cases when the database may only be created manyally by the admin?
I'd be grateful for you input/advises.
Thanks in advance.
Bye.
/lexi
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Generating SQL to initialize database
Posted by Eric Redmond <er...@gmail.com>.
I use this quite well. I create a seperate "pom" project that contains all
the information to generate and populate our test and production databases.
http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html
Eric
On 10/27/06, Fabricio Lemos <fa...@gmail.com> wrote:
>
> If the database may only be created by the admin, you can´t rely on
> HMB files. In that case you should have a script that creates the
> database and put it on the resources folder.
>
> On 10/27/06, Aleksei Valikov <va...@gmx.net> wrote:
> > Hi folks.
> >
> > I wonder, what is the usual approach to generate or include in
> distribution or
> > package the SQL that sets up the database (DDL)?
> >
> > For instance, I use Hyperjaxb to generate source code and Hibernate
> mappings
> > from the database schema. Based on the Hibernate mappings I can generate
> the DDL
> > that defines the database (there's a plugin to do that).
> >
> > What I completely miss is how this SQL should be packaged or distributed
> and so
> > on. With HBMs everything works very nice - they are just packaged as
> resources
> > in the JAR (together with Hibernate configuration). Currently I simply
> use the
> > automatic schema creation of Hibernate. That is, during the start-up the
> > Hibernate automatically exports the database schema into the database.
> But what
> > should I do in cases when the database may only be created manyally by
> the admin?
> >
> > I'd be grateful for you input/advises.
> > Thanks in advance.
> >
> > Bye.
> > /lexi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Eric Redmond
http://codehaus.org/~eredmond
Re: Generating SQL to initialize database
Posted by Fabricio Lemos <fa...@gmail.com>.
If the database may only be created by the admin, you can´t rely on
HMB files. In that case you should have a script that creates the
database and put it on the resources folder.
On 10/27/06, Aleksei Valikov <va...@gmx.net> wrote:
> Hi folks.
>
> I wonder, what is the usual approach to generate or include in distribution or
> package the SQL that sets up the database (DDL)?
>
> For instance, I use Hyperjaxb to generate source code and Hibernate mappings
> from the database schema. Based on the Hibernate mappings I can generate the DDL
> that defines the database (there's a plugin to do that).
>
> What I completely miss is how this SQL should be packaged or distributed and so
> on. With HBMs everything works very nice - they are just packaged as resources
> in the JAR (together with Hibernate configuration). Currently I simply use the
> automatic schema creation of Hibernate. That is, during the start-up the
> Hibernate automatically exports the database schema into the database. But what
> should I do in cases when the database may only be created manyally by the admin?
>
> I'd be grateful for you input/advises.
> Thanks in advance.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org