Menu

#120 RelationshipRole.compareTo bug in many2many

open
5
2003-10-21
2003-10-21
Jorge
No

Hi,

I've downloaded yesterday (20/10/2003) middlegen from
CVS and I have the following exception during the
middlegen task (that I DON'T have when I use the
middlegen-2.0-b1.zip):

[middlegen] - Registering plugin bmp20-
>middlegen.plugins.entitybean.BMP20Plugin
[middlegen] Database
URL:jdbc:postgresql://lorenx/borrar
[middlegen] - The table named servicio_categoria was
found in the schema named "null". However, Middlegen
was not configured to look for tables in a specific
schema. You should consider specifying schema="null" in
the middlegen task.
[middlegen] - The table named grupo was found in the
schema named "null". However, Middlegen was not
configured to look for tables in a specific schema. You
should consider specifying schema="null" in the
middlegen task.
[middlegen] - The table named servicio was found in
the schema named "null". However, Middlegen was not
configured to look for tables in a specific schema. You
should consider specifying schema="null" in the
middlegen task.
[middlegen] - The table named categoria was found in
the schema named "null". However, Middlegen was not
configured to look for tables in a specific schema. You
should consider specifying schema="null" in the
middlegen task.
[middlegen] - The table named servicio_grupo was
found in the schema named "null". However, Middlegen
was not configured to look for tables in a specific
schema. You should consider specifying schema="null" in
the middlegen task.
[middlegen] - Found a relation between grupo and
facturacion. Skipping it since facturacion isn't among the
specified tables.
[middlegen] - Found a relation between grupo and
suscripcion_perfil. Skipping it since suscripcion_perfil isn't
among the specified tables.
[middlegen] - Found a relation between servicio and
acceso. Skipping it since acceso isn't among the
specified tables.
[middlegen] - Found a relation between servicio and
suscripcion_usuario. Skipping it since suscripcion_usuario
isn't among the specified tables.
[middlegen] java.lang.IllegalStateException:
RelationshipRole.compareTo bug
[middlegen]
[middlegen] PLEASE FILE A BUG REPORT TO
http://sourceforge.net/tracker/?
group_id=36044&atid=415990.
[middlegen] ENCLOSE THE FOLLOWING INFORMATION:
[middlegen] -THIS STACK TRACE
[middlegen] -THE VERSION YOU'RE USING (DATE IF
YOU'RE USING CVS VERSION)
[middlegen]
[middlegen]
[middlegen]
[middlegen] at
middlegen.DbTable.addRelationshipRole(DbTable.java:328)
[middlegen] at middlegen.Relation.<init>
(Relation.java:142)
[middlegen] at
middlegen.MiddlegenPopulator.addMany2ManyRelations
(MiddlegenPopulator.java:846)
[middlegen] at
middlegen.MiddlegenPopulator.populate
(MiddlegenPopulator.java:265)
[middlegen] at middlegen.MiddlegenTask.execute
(MiddlegenTask.java:403)
[middlegen] at
org.apache.tools.ant.UnknownElement.execute
(UnknownElement.java:193)
[middlegen] at org.apache.tools.ant.Task.perform
(Task.java:341)
[middlegen] at
org.apache.tools.ant.Target.execute(Target.java:309)
[middlegen] at
org.apache.tools.ant.Target.performTasks
(Target.java:336)
[middlegen] at
org.apache.tools.ant.Project.executeTarget
(Project.java:1339)
[middlegen] at
org.apache.tools.ant.Project.executeTargets
(Project.java:1255)
[middlegen] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run
(InternalAntRunner.java:569)
[middlegen] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run
(InternalAntRunner.java:367)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[middlegen] at
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
[middlegen] at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[middlegen] at java.lang.reflect.Method.invoke
(Method.java:324)
[middlegen] at org.eclipse.ant.core.AntRunner.run
(AntRunner.java:335)
[middlegen] at
org.eclipse.ui.externaltools.internal.ant.launchConfiguratio
ns.AntLaunchDelegate$1.run
(AntLaunchDelegate.java:172)
[middlegen] at java.lang.Thread.run
(Thread.java:536)
[middlegen] BUILD FAILED:
file:Z:/Temp/Eclipse/eclipse/workspace/score/build.xml:9
4: java.lang.IllegalStateException:
RelationshipRole.compareTo bug

PLEASE FILE A BUG REPORT TO
http://sourceforge.net/tracker/?
group_id=36044&atid=415990.
ENCLOSE THE FOLLOWING INFORMATION:
-THIS STACK TRACE
-THE VERSION YOU'RE USING (DATE IF YOU'RE USING
CVS VERSION)

The middlegen task is the following:

<!-- Ejecutar middlegen -->
<target name="middlegen"
description="Ejecutar middlegen"
depends="cleanMiddlegen">
<taskdef name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="build.path" />
<middlegen appname="${name}"
prefsdir="${middlegen}" gui="false"
databaseurl="${database.url}"
initialContextFactory="${java.naming.factory.initial}"
providerURL="${java.naming.provider.url}"
datasourceJNDIName="${name}.database"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}" schema="">
<many2many>
<tablea name="servicio"/>
<jointable
name="servicio_grupo" generate="false"/>
<tableb name="grupo"/>
</many2many>
<many2many>
<tablea name="servicio"
generate="true"/>
<jointable
name="servicio_categoria" generate="false"/>
<tableb name="categoria"
generate="true"/>
</many2many>
<cmp20
destination="${middlegen.gen-src.dir}"
package="${middlegen.build.package}.ejb"
interfacepackage="${middlegen.build.package}.interfaces
" pkclass="false" dataobject="true" viewtype="local"
mergedir="${root}/src/middlegen" readonly="false"
fkcmp="true" guid="false">
<sequenceblock
package="${middlegen.sequence.package}.ejb"
interfacepackage="${middlegen.sequence.package}.interf
aces" table="sequence" />
<!-- Especificar contenedores
EJB -->
<jboss/>
</cmp20>
</middlegen>
</target>

The exception rises after including 2 many2many
relationships (it doesn't rise with only one).

The tables are very simple:

CREATE TABLE servicio (
idservicio INT4 NOT NULL,
idproveedor INT4 NOT NULL,
nombre VARCHAR(40) NOT NULL UNIQUE,
descripcion VARCHAR(40),
puntoacceso VARCHAR(128) NOT NULL,
suscribible BOOL DEFAULT false NOT NULL,
facturable BOOL DEFAULT false NOT NULL,
activado BOOL DEFAULT false NOT NULL,
cifrado BOOL DEFAULT false NOT NULL,
integridad BOOL DEFAULT false NOT NULL,
PRIMARY KEY (idservicio)
);

CREATE TABLE grupo (
idgrupo INT4 NOT NULL,
nombre VARCHAR(40) NOT NULL UNIQUE,
descripcion VARCHAR(40),
PRIMARY KEY (idgrupo)
);

CREATE TABLE servicio_grupo (
idservicio INT4 NOT NULL,
idgrupo INT4 NOT NULL,
PRIMARY KEY (idservicio, idgrupo)
);

CREATE TABLE categoria (
idcategoria INT4 NOT NULL,
nombre VARCHAR(40) NOT NULL UNIQUE,
descripcion VARCHAR(40),
idcategoriapadre INT4,
PRIMARY KEY (idcategoria)
);

CREATE TABLE servicio_categoria (
idservicio INT4 NOT NULL,
idcategoria INT4 NOT NULL,
PRIMARY KEY (idservicio, idcategoria)
);

I remind you that the downloadable middlegen version
doesn't rise this exception.

Regards,
Jorge

Discussion


Log in to post a comment.