Hi,

I am having trouble implementing an M:M relationship (castor version 9.6). The 
problem seems to stem from from an "extends" relationship. I have the 
following classes:

Product
Accomodation is-a Product
ComposedProduct is-a Product  with relationship (n) <------------> (n) Product

I have the following tables (and relationships):

Product ----------- OfferComposition ---------- ComposeOffer
   |
   |
Accomodation

Product, Accomodation and ComposedOffer contain the information for Product, 
Accomodation and ComposedProduct classes respectivelly. 
The table OfferComposition let me have the N:N relationship between a Product 
and a CompodesProduct.

Problem: when I establish a relationship between the Product and 
ComposedProduct classes, the tables are filled in correctly. However when I 
add an Accomodation to the relationship I get an additional line in 
OfferComposition with an invalid id. Any extends relationship results in this 
spurious line.

Interestingly: OfferComposition has two fields; one for the Product id, the 
other for the composed product. The spurious line contains the correct 
composed product id but has an id 0 for the extended product:

composed : id = 2
product: id = 1
Accom: id = 3

offer product
2       1 <------ ok, composed to related to normal product
2       0 <------ spurious line added only when adding relation composed to 
accom.
2       3 <------ ok, adding relation between relation and accom.

Any way around this? I have code to show this, but is extensive and cannot 
attach it here (Java classes including test, mapping.xml, and databse DDL 
script). Any help is appreciated.

TIA,
Hugo Ferreira.



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to