Discussion:
[Middlegen-user] MiddleGen bug?
Nuno Duarte Santos (Ext)
2004-03-22 08:40:30 UTC
Permalink
Hello,

I am trying to use Middlegen with the following DB schema:


Table Persons table Reservations
person_id PK reservations_id PK
person_id_fk FK
person_id2_fk FK


This kind of relationship generates an error when Xdoclet is trying to build the VO because middlegen repeats the xdoclet tag
@ejb.value-object
* aggregate="${plugin.interfacePackage}.${target.baseClassName}LightValue"
* aggregate-name="${target.baseClassName}" <----
* members="$target.localClassName"
* members-name="${target.baseClassName}" <----
* match="all"
* relation="external"
* type="java.util.Collection"
#else
* @ejb.value-object
* aggregate="${plugin.interfacePackage}.${target.baseClassName}LightValue"
* aggregate-name="${target.baseClassName}" <-----
* match="all"
* relation="external"


the tags marked with <---- will cause the Xdoclet to generate classes with repeated variable and methods names

I changed the <---- to "$table.getVariableName($relationshipRole)", this solved the problem but I didn't like the outcome.

do you have a better solution?

P.S -> I don't want to refactor the DB schema


Regards,
Nuno Duarte Santos
Eivind Waaler
2004-03-24 07:31:04 UTC
Permalink
I believe there's a bug in Middlegen when you have two foreign keys
pointing to the same table.

Think maybe someone had a quickfix for this? Try searching the mailing
list archives..

.eivind
Post by Nuno Duarte Santos (Ext)
Hello,
Table Persons table Reservations
person_id PK reservations_id PK
person_id_fk FK
person_id2_fk FK
This kind of relationship generates an error when Xdoclet is trying to build the VO because middlegen repeats the xdoclet tag
@ejb.value-object
* aggregate="${plugin.interfacePackage}.${target.baseClassName}LightValue"
* aggregate-name="${target.baseClassName}" <----
* members="$target.localClassName"
* members-name="${target.baseClassName}" <----
* match="all"
* relation="external"
* type="java.util.Collection"
#else
* aggregate="${plugin.interfacePackage}.${target.baseClassName}LightValue"
* aggregate-name="${target.baseClassName}" <-----
* match="all"
* relation="external"
the tags marked with <---- will cause the Xdoclet to generate classes with repeated variable and methods names
I changed the <---- to "$table.getVariableName($relationshipRole)", this solved
Loading...