Skip to main content



      Home
Home » Modeling » EMF » Bidirectional reference(Bidirectional reference tables problem)
Bidirectional reference [message #632269] Tue, 12 October 2010 07:36 Go to next message
Eclipse UserFriend
Hello,

I have a following problem:

1. object A has reference (0 ... *) to object B,
2. reference B has set eopposite attribute to A,
3. object B has reference (0 ... *) to object A,
4. reference A has set eopposite attribute to B.

So, it is bidirectional reference. A problem is that there are created two independent tables connecting A with B :

1. A -> AB -> B
2. B -> BA -> A

I need one table e.g. AB to be able to set/get one list of objects in two places. Could you indicate me solution of this problem?

MaK
Re: Bidirectional reference [message #632278 is a reply to message #632269] Tue, 12 October 2010 08:12 Go to previous messageGo to next message
Eclipse UserFriend
MaK,

Comments below.


MaK wrote:
> Hello,
>
> I have a following problem:
> 1. object A has reference (0 ... *) to object B,
> 2. reference B has set eopposite attribute to A,
It would be more clear if you gave these references names; after all,
the opposite is a feature not a class.
> 3. object B has reference (0 ... *) to object A,
> 4. reference A has set eopposite attribute to B.
So there are two different bidirectional references between A and B or
just one.
>
> So, it is bidirectional reference. A problem is that there are created
> two independent tables connecting A with B :
>
> 1. A -> AB -> B
> 2. B -> BA -> A
Tables? This is a question about Teneo?
>
> I need one table e.g. AB to be able to set/get one list of objects in
> two places. Could you indicate me solution of this problem?
>
> MaK
Re: Bidirectional reference [message #632299 is a reply to message #632278] Tue, 12 October 2010 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Ed Merks wrote on Tue, 12 October 2010 08:12
MaK,

Comments below.


MaK wrote:
> Hello,
>
> I have a following problem:
> 1. object A has reference (0 ... *) to object B,
> 2. reference B has set eopposite attribute to A,
It would be more clear if you gave these references names; after all,
the opposite is a feature not a class.
> 3. object B has reference (0 ... *) to object A,
> 4. reference A has set eopposite attribute to B.
So there are two different bidirectional references between A and B or
just one.
>
> So, it is bidirectional reference. A problem is that there are created
> two independent tables connecting A with B :
>
> 1. A -> AB -> B
> 2. B -> BA -> A
Tables? This is a question about Teneo?

It's about CDO.

>
> I need one table e.g. AB to be able to set/get one list of objects in
> two places. Could you indicate me solution of this problem?
>
> MaK

[CDO] Bidirectional reference [message #632320 is a reply to message #632299] Tue, 12 October 2010 10:26 Go to previous messageGo to next message
Eclipse UserFriend
MaK,

Please prefix questions about CDO with [CDO]


MaK wrote:
> Ed Merks wrote on Tue, 12 October 2010 08:12
>> MaK,
>>
>> Comments below.
>>
>>
>> MaK wrote:
>> > Hello,
>> >
>> > I have a following problem:
>> > 1. object A has reference (0 ... *) to object B,
>> > 2. reference B has set eopposite attribute to A,
>> It would be more clear if you gave these references names; after all,
>> the opposite is a feature not a class.
>> > 3. object B has reference (0 ... *) to object A,
>> > 4. reference A has set eopposite attribute to B.
>> So there are two different bidirectional references between A and B
>> or just one.
>> >
>> > So, it is bidirectional reference. A problem is that there are
>> created > two independent tables connecting A with B :
>> >
>> > 1. A -> AB -> B
>> > 2. B -> BA -> A
>> Tables? This is a question about Teneo?
>>
>> It's about CDO.
>>
>> >
>> > I need one table e.g. AB to be able to set/get one list of objects
>> in > two places. Could you indicate me solution of this problem?
>> >
>> > MaK
>
>
Re: [CDO] Bidirectional reference [message #632343 is a reply to message #632269] Tue, 12 October 2010 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mak,

I suspect that you're using the DBStore of CDO? While it is theoretically possible with this store to customize the IMappingStrategy, the IClassMappings, etc, I doubt that many people have tried that so far. The particular kind of mapping you seem to require is not possible with the DBStore as it is shipped. Maybe Stefan wants to add something?

I guess that the HibernateStore is more likely to support complex mapping types. Martin?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 12.10.2010 13:36, schrieb MaK:
> Hello,
>
> I have a following problem:
> 1. object A has reference (0 ... *) to object B,
> 2. reference B has set eopposite attribute to A, 3. object B has reference (0 ... *) to object A,
> 4. reference A has set eopposite attribute to B.
>
> So, it is bidirectional reference. A problem is that there are created two independent tables connecting A with B :
>
> 1. A -> AB -> B
> 2. B -> BA -> A
>
> I need one table e.g. AB to be able to set/get one list of objects in two places. Could you indicate me solution of this problem?
>
> MaK
Re: [CDO] Bidirectional reference [message #632415 is a reply to message #632343] Tue, 12 October 2010 15:54 Go to previous message
Eclipse UserFriend
Hi,
The HibernateStore allows you to override the default mapping in detail,
including specifying join tables etc. There are some specifics however
for n:m associations which need to be indexed (set vs. list semantics),
see here for details:
http://wiki.eclipse.org/Teneo/Hibernate/ModelRelational/Asso ciation_Mapping

For more info on the hibernatestore and its mapping capabilities see here:
http://wiki.eclipse.org/CDO_Hibernate_Store_Model_Relational _Mapping

For general info on the HibernateStore see here:
http://wiki.eclipse.org/CDO_Hibernate_Store


With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org


On 10/12/2010 05:24 PM, Eike Stepper wrote:
> Hi Mak,
>
> I suspect that you're using the DBStore of CDO? While it is
> theoretically possible with this store to customize the
> IMappingStrategy, the IClassMappings, etc, I doubt that many people
> have tried that so far. The particular kind of mapping you seem to
> require is not possible with the DBStore as it is shipped. Maybe
> Stefan wants to add something?
>
> I guess that the HibernateStore is more likely to support complex
> mapping types. Martin?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
> Am 12.10.2010 13:36, schrieb MaK:
>> Hello,
>>
>> I have a following problem:
>> 1. object A has reference (0 ... *) to object B,
>> 2. reference B has set eopposite attribute to A, 3. object B has
>> reference (0 ... *) to object A,
>> 4. reference A has set eopposite attribute to B.
>>
>> So, it is bidirectional reference. A problem is that there are
>> created two independent tables connecting A with B :
>>
>> 1. A -> AB -> B
>> 2. B -> BA -> A
>>
>> I need one table e.g. AB to be able to set/get one list of objects in
>> two places. Could you indicate me solution of this problem?
>>
>> MaK
>

--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:inheritance from own defined EDataType
Next Topic:[CDO] Timeout when connecting to server
Goto Forum:
  


Current Time: Mon Jul 14 02:17:28 EDT 2025

Powered by FUDForum. Page generated in 0.31777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top