Home » Modeling » EMF » Bidirectional reference(Bidirectional reference tables problem)
| | |
[CDO] Bidirectional reference [message #632320 is a reply to message #632299] |
Tue, 12 October 2010 14:26 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
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
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [CDO] Bidirectional reference [message #632343 is a reply to message #632269] |
Tue, 12 October 2010 15:24 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Bidirectional reference [message #632415 is a reply to message #632343] |
Tue, 12 October 2010 19:54 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
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
|
|
|
Goto Forum:
Current Time: Wed Apr 24 20:03:06 GMT 2024
Powered by FUDForum. Page generated in 0.03083 seconds
|