Oracle TopLink + composite mapping  
Author Message
blochoo





PostPosted: 2006-10-29 22:57:00 Top

java-programmer, Oracle TopLink + composite mapping Hello,

I have a little problem with Toplink:

I have a table in Oracle DB:

table T1 {A: integer, B: integer, C: integer}.

I want to have following mapping:

class X { int A; intB;}
class Y{ X objct; int C}

so the objct (of class X) is a composite of class Y, and both of
objects (composite and owner) are in the same table.

Is it possible to make such a mapping in TopLink?

Thanks for every helpful answer.
 
simon.martinelli@gmail.com





PostPosted: 2006-10-30 23:46:00 Top

java-programmer >> Oracle TopLink + composite mapping Hi,

Yes that's possible.

Map X as Aggregate Mapping.

If you now map Y as "normal" Class Mapping you can choose the
attributes of X to map to the database.

Regards, Simon


blochoo wrote:
> Hello,
>
> I have a little problem with Toplink:
>
> I have a table in Oracle DB:
>
> table T1 {A: integer, B: integer, C: integer}.
>
> I want to have following mapping:
>
> class X { int A; intB;}
> class Y{ X objct; int C}
>
> so the objct (of class X) is a composite of class Y, and both of
> objects (composite and owner) are in the same table.
>
> Is it possible to make such a mapping in TopLink?
>
> Thanks for every helpful answer.
> --
> Piotr Bloch
> CS @ PUT
> Poland

 
blochoo





PostPosted: 2006-10-31 6:02:00 Top

java-programmer >> Oracle TopLink + composite mapping
email***@***.com napisal(a):
> Hi,
>
> Yes that's possible.
>
> Map X as Aggregate Mapping.
>
> If you now map Y as "normal" Class Mapping you can choose the
> attributes of X to map to the database.
>
> Regards, Simon

Thank You, Simon. It solved my problem.

Regards,
Piotr Bloch