Discussion:
[Middlegen-user] library name for an AS400 DB2
N***@arsoe-trelaze.com
2004-05-07 06:12:08 UTC
Permalink
Middlegen works for my script in a MySQL data base but it fail for a DB2
database on an AS400.

When I want to get my table the name is prefix with the library name (for
example : CIADATA.ORGCIA) but it failed to find the table as it did not exist. This is probably
due to the use of a library name with the classe name. Maybe I ommit some
properties of the ant task !

Error message :

build:start:

middlegen:ant:
Database URL:jdbc:as400://ASDEV.arsoe.pl

BUILD FAILED
File...... file:/C:/Documents and
Settings/chalumeau/.maven/plugins/maven-metier-plugin-1.0/plugin.jelly
Element... middlegen
Line...... 133
Column.... 62
middlegen.MiddlegenException: The database doesn't have any table named
CIADATATR.COOP. Please make sure the table exists. Also note that some
databases are case sensitive.
Total time: 10 seconds
Finished at: Fri May 07 10:09:43 CEST 2004

My call task in a maven.xml :

<goal name="middlegen:ant">
<ant:taskdef
name="middlegen"
classname="middlegen.MiddlegenTask"
<ant:classpath>
<ant:pathelement
location="${plugin.getDependencyPath('middlegen:middlegen')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('middlegen:middlegen-entitybean-plugin')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('ant:ant')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('velocity:velocity')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('log4j:log4j')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('commons-collections:commons-collections')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('commons-jelly:commons-jelly')}"/>
<ant:pathelement
location="${plugin.getDependencyPath('jtopen:jtopen')}"/>
<ant:path refid="maven.dependency.classpath"/>
</ant:classpath>
</ant:taskdef>

<middlegen appname="${maven.middlegen.appname}"
prefsdir="${maven.middlegen.prefsdir}"
gui="${maven.middlegen.gui}"
databaseurl="${maven.middlegen.database.url}"
driver="${maven.middlegen.database.driver}"
username="${maven.middlegen.database.userid}"
password="${maven.middlegen.database.password}"
schema="${maven.middlegen.database.schema}">

<table name="CIADATA.ORGCIA" singular="cooperative" plural="cooperatives"/>

<java package="com.arsoe.trelaze.metier" destination="target/src">
<fileproducer template="src/main/resources/middlegen/socle-ojb.vm" filename="{0}.java" destination="target/src">
</fileproducer>
</java>
</middlegen>

</goal>

Middlegen properties :

maven.middlegen.appname = ${pom.artifactId}
maven.middlegen.prefsdir = target/middlegen/pref
maven.middlegen.gui = false
maven.middlegen.database.driver = com.ibm.as400.access.AS400JDBCDriver
maven.middlegen.database.url = jdbc:as400://ASDEV.arsoe.pl
maven.middlegen.database.userid = root
maven.middlegen.database.password = root
maven.middlegen.database.drop.script =
${maven.src.dir}/sql/drop-${pom.id}-mysql.sql
maven.middlegen.database.create.script =
${maven.src.dir}/sql/create-${pom.id}-mysql.sql
maven.middlegen.database.schema =
maven.middlegen.database.catalog =

Loading...