Here is the situation:
 
B extends A; the fields B inherits from A exist in table_a, and the fields that belong 
to B exist in table_b
I want to inherit all of B's fields into C, and have those fields populate table_c and 
not table_b
However, I want the mapping between C and A to work like that mapping between B and A: 
the field's C inherits from A should populate table_a and the fields inherited from B 
and belonging to C should populate table_c. 
 
Populating table_C with fields from C and B is working, however, populating table_a 
with the inherited fields is not working
 
Pointing the super reference to B populates table_b instead of table_c
 
Any ideas?

________________________________

From: Thomas Dudziak [mailto:[EMAIL PROTECTED]
Sent: Thu 7/8/2004 1:43 PM
To: OJB Users List
Subject: Re: 2nd try: inheritance issues



Mindy Pereira wrote:

>I am still having no luck mapping the following relationship:
>
>A
>
>B extends A
>
>C extends B
>
>
>
>The relationships between B and A and C and B are mapping correctly. However, obj 
>seems unaware of the relationship between C and A:
>
>Caused by: org.apache.ojb.broker.metadata.MetadataException: Class A is not a 
>superclass of class C
>
>when I include:
>
><reference-descriptor name="super" class-ref="A" auto-update="true">
>
><foreignkey field-ref="mId" />
>
></reference-descriptor>
>
>However, not including that line means that the fields inherited by class C from 
>class A are not recognized when saving an object of class C.
>
>Can anyone offer any advice? Does ojb not support this sort of relationship?
> 
>
You specified A in the reference descriptor, not B, so I guess you want
to bypass B in this mapping. For this to work, B should not be declared
in the repository.xml and you need an extent-class in the class
descriptor of A that points to C.
If you did not want to bypass B, then the super-reference should point
to B, not to A.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to