Discussion:
[Middlegen-user] [Relation-Name] name + null
Joao Miguel Garcia
2002-07-04 10:40:04 UTC
Permalink
Hi all,

Is there a logical reason for all the relations created with Middlegen having "null" in the end.
For example:

/**
* Returns the related pt.oniway.billing.brtm.data.ejb.interfaces.SampleLocal
*
* @return the related pt.oniway.billing.brtm.data.ejb.interfaces.SampleLocal
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="INVOICEREVIEW-SAMPLEnull"
* role-name="invoicereview-has-sample"
* @jboss:relation
* fk-constraint="true"
* fk-column="$relationshipRole.targetRole.columnMap.foreignKey"
* related-pk-field="$target.getColumn($relationshipRole.targetRole.columnMap.primaryKey).variableName"
*
*/

As you can see the relation is called "INVOICEREVIEW-SAMPLEnull".

Why "null" in the end????

Thanks,

João Miguel Garcia
IT Billing
OniWay
Av. Almirantes Reis, 65 - Edifício D
1150-011 Lisboa
Mobile: 96 849 37 10
Aslak Hellesøy
2002-07-04 16:28:06 UTC
Permalink
-----Original Message-----
Miguel Garcia
Sent: 4. juli 2002 14:39
Subject: [Middlegen-user] [Relation-Name] name + null
Hi all,
Is there a logical reason for all the relations created with
Middlegen having "null" in the end.
The logical reason is: "It was a bug." Fixed now. Thanks for reporting this.

/Aslak
M-Leander Reimer
2002-07-05 05:00:05 UTC
Permalink
Hi everyone,
this morning I have two things:

1. The generated @jboss tag for relations seems to be wring (this is
what it says in e.g. FlightBean.java)

* @jboss.relation
* fk-constraint="true"
* fk-column="$relationshipRole.targetRole.columnMap.foreignKey"
*related-pk-field="$target.getColumn($relationshipRole.targetRole.columnMap.primaryKey).variableName"

The column names are not filled in properly I guess. This results in a
faulty jbosscmp-jdbc.xml file in the relation section. Is it because
Velocity can't find the proper methods in the plugin?

2. This is more of a design question on the Flight-Person-Reservation
demo and n:m relations in general. Why would I include e.g. in the
FlightBean a method to get/set persons, when I modelled the n:m relation
between Flight-Person through the Reservation?
The set/get person/flights CMR methods in the FlightBean/PersonBean (+
their CMR tags) result in a separate relation table which is not really
needed since we have the ReservationBean.
The way I understand it, is that I can either transform an n:m relation
into 2 n:1 relations using a separate table (like reservations) OR I can
use a "true" n:m CMR relation where the container generates the table
for me and handles the realation through get/set Persons/Flights?

Am I completely wrong on this? What do you think?

Thanks a lot everyone!

Leander
M-Leander Reimer
2002-07-08 14:06:04 UTC
Permalink
Hi,

Regarding my first question: I got a fresh CVS snapshot and the error
doesn't occur anymore. Great!
Post by M-Leander Reimer
what it says in e.g. FlightBean.java)
* fk-constraint="true"
* fk-column="$relationshipRole.targetRole.columnMap.foreignKey"
*related-pk-field="$target.getColumn($relationshipRole.targetRole.columnMap.primaryKey).variableName"
Second: Shame on me!! :-) It seems that I hadn't fully understood the
many2many attribute of the cmp20 task. After I set it to "false"
everything worked fine. So in case of an m..n relation and a table which
already models such a relation AND many2many set to true the CMR stuff
gets generated twice. Correct?
Post by M-Leander Reimer
2. This is more of a design question on the Flight-Person-Reservation
demo and n:m relations in general. Why would I include e.g. in the
FlightBean a method to get/set persons, when I modelled the n:m relation
between Flight-Person through the Reservation?
The set/get person/flights CMR methods in the FlightBean/PersonBean (+
their CMR tags) result in a separate relation table which is not really
needed since we have the ReservationBean.
The way I understand it, is that I can either transform an n:m relation
into 2 n:1 relations using a separate table (like reservations) OR I can
use a "true" n:m CMR relation where the container generates the table
for me and handles the realation through get/set Persons/Flights?
Sorry again for asking stupid questions :-) That's it!

Leander

Loading...