You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lally Singh <la...@gmail.com> on 2007/11/05 21:57:23 UTC

Getting Hibernate3's hbm2ddl to generate SQL but not wipe my db?

Hey everyone, I'm trying to get the plugin to generate my SQL code,
but I can't seem to do it without it trying to connect to my db.

Is there an option that tells it to generate the .sql, but not run it,
clobbering my existing db?

Thanks,

-ls

-- 
H. Lally Singh
Ph.D. Candidate, Computer Science
Virginia Tech

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Getting Hibernate3's hbm2ddl to generate SQL but not wipe my db?

Posted by Paul MERLIN <pa...@nosphere.org>.
On Monday 05 November 2007 21:57:23 Lally Singh wrote:
> Hey everyone, I'm trying to get the plugin to generate my SQL code,
> but I can't seem to do it without it trying to connect to my db.
>
> Is there an option that tells it to generate the .sql, but not run it,
> clobbering my existing db?
>
> Thanks,
>
> -ls

Hi,

I'm using this and it does not need a running database :

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <configuration>
                    <components>
                        <component>
                            <name>hbm2ddl</name>
                        </component>
                    </components>
                    <componentProperties>
                        <implementation>jpaconfiguration</implementation>
                        <outputfilename>entities-schema.sql</outputfilename>
                        <drop>true</drop>
                        <create>true</create>
                        <update>false</update>
                        <export>false</export>
                        <ejb3>true</ejb3>
                    </componentProperties>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>hbm2ddl</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.derby</groupId>
                <artifactId>derbyclient</artifactId>
                <version>10.3.1.4</version>
            </extension>
        </extensions>
    </build>

The extension derbyclient is here because I use DerbyDialect.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org