Hey,
ive been using middlegen to generate my mapping files. It works great. It generates a mapping for all the tables in my schema (approximately 20 tables) . Except when I added the following
<many2many>
<tablea generate="true" name="MERCHANTS" />
<jointable name="GROUPS_MERCHANTS" generate="false" />
<tableb generate="true" name="GROUPS" />
</many2many>
After I added this many-to-many restraint, all the other tables in my schema (except groups and merchants) disappeared. The middlegen view now only shows 2 tables!! This is what my ant task looks like:
<target
name="mymiddlegen"
description="Run Middlegen"
unless="middlegen.skip"
depends="init,fail-if-no-xdoclet-1.2,check-driver-present,panic-if-driver-not-present"
>
<mkdir dir="${build.gen-src.dir}"/>
<echo message="Class path = ${basedir}"/>
<taskdef
name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="lib.class.path"
/>
<middlegen
appname="${name}"
prefsdir="${src.dir}"
gui="${gui}"
databaseurl="${database.url}"
initialContextFactory="${java.naming.factory.initial}"
providerURL="${java.naming.provider.url}"
datasourceJNDIName="${datasource.jndi.name}"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}"
schema="${database.schema}"
catalog="${database.catalog}"
>
<many2many>
<tablea generate="true" name="MERCHANTS" />
<jointable name="GROUPS_MERCHANTS" generate="false" />
<tableb generate="true" name="GROUPS" />
</many2many>
<!-- Plugins -->
<hibernate
destination="${build.gen-src.dir}"
package="${name}.hibernate"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
</middlegen>
<mkdir dir="${build.classes.dir}"/>
</target>
Any ideas?
|