db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: m2 torque plugin
Date Mon, 24 Sep 2007 20:50:38 GMT
a) There is no maven2 plugin for Torque 3.1.1. The current m2 plugin uses
the 3.3.RCx generator. I'd not recommend using it with a 3.1.1 runtime.
Consider upgrading; otherwise consider building a m2 plugin yourself which
uses the 3.1.1 generator.

b) I'm afraid there is no example in the website. In principle, you only
have to insert the plugin in the bild/plugins section of the pom. In the
test project we use the following snippet:

      <plugin>
        <groupId>org.apache.torque</groupId>
        <artifactId>torque-maven-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <schemaDir>target/torque/test/schema</schemaDir>
          <targetDatabase>${torque.targetDatabase}</targetDatabase>
          <targetPackage>org.apache.torque.test</targetPackage>
          <useManagers>${torque.useManagers}</useManagers>
          <generateBeans>${torque.generateBeans}</generateBeans>
          <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
          <driver>${torque.driver}</driver>
          <url>${torque.database.url}</url>
          <user>${torque.database.user}</user>
          <password>${torque.database.password}</password>
          <projectName>bookstore</projectName>
        </configuration>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <id>om</id>
            <goals>
              <goal>om</goal>
              <goal>sql</goal>
              <goal>sqlExec</goal>
              <goal>documentation</goal>
            </goals>
          </execution>
          <execution>
            <phase>test</phase>
            <id>data</id>
            <goals>
              <goal>datadtd</goal>
              <goal>datadump</goal>
              <goal>datasql</goal>
            </goals>
            <configuration>
              <xmlFile>target/torque/test/schema/bookstore-schema.xml</xmlFile>

              <dataXmlFile>target/data/torque/bookstore-bookstore-all-data.xml</dataXmlFile>

              <dataDtd>target/data/torque/bookstore-data.dtd</dataDtd>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <artifactId>${torque.test.driver.artifactId}</artifactId>
            <groupId>${torque.test.driver.groupId}</groupId>
            <version>${torque.test.driver.version}</version>
          </dependency>
        </dependencies>
      </plugin>

Probably you only need one execution. Also you need to fill the ${...}
variables with correct values (you can also omit some of these, not all are
required; check the plugin documentation.)

  Hope that helps,

         Thomas

-----"jill han" <jhan@bynum.com> schrieb: -----
>An: "Apache Torque Users List" <torque-user@db.apache.org>
>Von: "jill han" <jhan@bynum.com>
>Datum: 24.09.2007 10:25PM
>Thema: RE: m2 torque plugin
>
>Thanks for the reply, Thomas
>I am using torque-3.1.1
>Is there any sample pom to show how the <plugin> is constructed?
>
>Thanks,
>
>Jill
>
>     Thomas
>-----Original Message-----
>From: jill han
>Sent: Tuesday, September 18, 2007 1:52 PM
>To: 'Apache Torque Users List'
>Subject: m2 torque plugin
>
>I just moved from m1 to m2, but could not get torque plugin work.
>with m1, I used command, maven torque:om, which will build db object
>from *schema.xml.
>I could not find instructions on doing this.
>Is there anybody who has done it and like to offer some helps?
>I really appreciate.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message