Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Don't understand JPA generation strategy on bidir relation 0..1 to 0..*
[Texo] Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #797519] Mon, 13 February 2012 15:36 Go to next message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
Hi all,

Let's consider 2 use cases :

1)

index.php/fa/7130/0/

2)

index.php/fa/7131/0/

In both cases, this is a bidirectional relation, with opposite correctly set. Both relations are set unordered.

But in the use case 1, a joined table is generated. In the use case 2, the mapped-by property is correctly set.

My question is : why is a joined table used in the use case 1 ? Because I don't see a valid modeling reason.

Thanks in advance !

[Updated on: Mon, 13 February 2012 16:27]

Report message to a moderator

Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #797630 is a reply to message #797519] Mon, 13 February 2012 18:19 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Benoit,
There are properties you can set in the annotation model on epackage level which control if join tables are created for
associations (contained or non-contained). As a default for containment associations no-join table is used and for
non-containment associations a join table is used.

Does this answer your question?

gr. Martin

On 02/13/2012 04:36 PM, Benoit Cantin wrote:
> Hi all,
>
> Let's consider 2 use cases :
>
> 1)
>
>
>
> 2)
>
>
>
> In both cases, this is a bidirectional relation, with opposite correctly set. Both relations are set unordered.
>
> But in the use case 1, a joined table is generated. In the use case 2, the mapped-by property is correctly set.
>
> My question is : why is a joined table used in the use case 1 ? Because I don't see a valid modeling reason.
>
> Thanks in advance !


--

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
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #798080 is a reply to message #797630] Tue, 14 February 2012 08:17 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
Hi Martin,

This sounds like to be the solution. But it is not working. Whether I set "Use join tables for non containment" or not, a join table is generated. I've also tested the option "Use join tables for containment" and this one is working correctly. Sounds like a bug ?
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #798325 is a reply to message #798080] Tue, 14 February 2012 14:37 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Sounds indeed like a bug, can you file a bugzilla?

gr. Martin

On 02/14/2012 09:17 AM, Benoit Cantin wrote:
> Hi Martin,
>
> This sounds like to be the solution. But it is not working. Whether I set "Use join tables for non containment" or not,
> a join table is generated. I've also tested the option "Use join tables for containment" and this one is working
> correctly. Sounds like a bug ?


--

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
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #798388 is a reply to message #798325] Tue, 14 February 2012 16:22 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
On 02/14/2012 03:37 PM, Martin Taal wrote:
> Sounds indeed like a bug, can you file a bugzilla?

Yes. Done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=371509

> gr. Martin
>
> On 02/14/2012 09:17 AM, Benoit Cantin wrote:
>> Hi Martin,
>>
>> This sounds like to be the solution. But it is not working. Whether I
>> set "Use join tables for non containment" or not,
>> a join table is generated. I've also tested the option "Use join
>> tables for containment" and this one is working
>> correctly. Sounds like a bug ?
>
>
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #815996 is a reply to message #798388] Thu, 08 March 2012 09:41 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
Hi Martin,

Are you sure that this correction is available in the latest build ? I
still have the problem.

Same remark with https://bugs.eclipse.org/bugs/show_bug.cgi?id=372239

On 02/14/2012 05:22 PM, Benoit Cantin wrote:
> On 02/14/2012 03:37 PM, Martin Taal wrote:
>> Sounds indeed like a bug, can you file a bugzilla?
>
> Yes. Done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=371509
>
>> gr. Martin
>>
>> On 02/14/2012 09:17 AM, Benoit Cantin wrote:
>>> Hi Martin,
>>>
>>> This sounds like to be the solution. But it is not working. Whether I
>>> set "Use join tables for non containment" or not,
>>> a join table is generated. I've also tested the option "Use join
>>> tables for containment" and this one is working
>>> correctly. Sounds like a bug ?
>>
>>
>
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #816035 is a reply to message #815996] Thu, 08 March 2012 10:40 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
On 03/08/2012 10:41 AM, Benoit Cantin wrote:
> Hi Martin,
>
> Are you sure that this correction is available in the latest build ? I
> still have the problem.
>
> Same remark with https://bugs.eclipse.org/bugs/show_bug.cgi?id=372239

from what I can see on hudson, the last build (containing those updates)
didn't run.

++

> On 02/14/2012 05:22 PM, Benoit Cantin wrote:
>> On 02/14/2012 03:37 PM, Martin Taal wrote:
>>> Sounds indeed like a bug, can you file a bugzilla?
>>
>> Yes. Done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=371509
>>
>>> gr. Martin
>>>
>>> On 02/14/2012 09:17 AM, Benoit Cantin wrote:
>>>> Hi Martin,
>>>>
>>>> This sounds like to be the solution. But it is not working. Whether I
>>>> set "Use join tables for non containment" or not,
>>>> a join table is generated. I've also tested the option "Use join
>>>> tables for containment" and this one is working
>>>> correctly. Sounds like a bug ?
>>>
>>>
>>
>
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #816056 is a reply to message #816035] Thu, 08 March 2012 11:15 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Ha indeed! I did not abort it, not sure what happened, I kind of was focused on if the small icon was red, and did not
see the difference between grey and blue...

Doing a new build now!

gr. Martin


On 03/08/2012 11:40 AM, Benoit Cantin wrote:
> On 03/08/2012 10:41 AM, Benoit Cantin wrote:
>> Hi Martin,
>>
>> Are you sure that this correction is available in the latest build ? I
>> still have the problem.
>>
>> Same remark with https://bugs.eclipse.org/bugs/show_bug.cgi?id=372239
>
> from what I can see on hudson, the last build (containing those updates) didn't run.
>
> ++
>
>> On 02/14/2012 05:22 PM, Benoit Cantin wrote:
>>> On 02/14/2012 03:37 PM, Martin Taal wrote:
>>>> Sounds indeed like a bug, can you file a bugzilla?
>>>
>>> Yes. Done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=371509
>>>
>>>> gr. Martin
>>>>
>>>> On 02/14/2012 09:17 AM, Benoit Cantin wrote:
>>>>> Hi Martin,
>>>>>
>>>>> This sounds like to be the solution. But it is not working. Whether I
>>>>> set "Use join tables for non containment" or not,
>>>>> a join table is generated. I've also tested the option "Use join
>>>>> tables for containment" and this one is working
>>>>> correctly. Sounds like a bug ?
>>>>
>>>>
>>>
>>
>


--

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
Re: [Texo]Don't understand JPA generation strategy on bidir relation 0..1 to 0..* [message #816251 is a reply to message #816056] Thu, 08 March 2012 15:56 Go to previous message
Benoit Cantin is currently offline Benoit Cantin
Messages: 34
Registered: January 2012
Member
Ok, I got the new version, and the bug is corrected.

Thank you !

On 03/08/2012 12:15 PM, Martin Taal wrote:
> Ha indeed! I did not abort it, not sure what happened, I kind of was
> focused on if the small icon was red, and did not see the difference
> between grey and blue...
>
> Doing a new build now!
>
> gr. Martin
>
>
> On 03/08/2012 11:40 AM, Benoit Cantin wrote:
>> On 03/08/2012 10:41 AM, Benoit Cantin wrote:
>>> Hi Martin,
>>>
>>> Are you sure that this correction is available in the latest build ? I
>>> still have the problem.
>>>
>>> Same remark with https://bugs.eclipse.org/bugs/show_bug.cgi?id=372239
>>
>> from what I can see on hudson, the last build (containing those
>> updates) didn't run.
>>
>> ++
>>
>>> On 02/14/2012 05:22 PM, Benoit Cantin wrote:
>>>> On 02/14/2012 03:37 PM, Martin Taal wrote:
>>>>> Sounds indeed like a bug, can you file a bugzilla?
>>>>
>>>> Yes. Done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=371509
>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 02/14/2012 09:17 AM, Benoit Cantin wrote:
>>>>>> Hi Martin,
>>>>>>
>>>>>> This sounds like to be the solution. But it is not working. Whether I
>>>>>> set "Use join tables for non containment" or not,
>>>>>> a join table is generated. I've also tested the option "Use join
>>>>>> tables for containment" and this one is working
>>>>>> correctly. Sounds like a bug ?
>>>>>
>>>>>
>>>>
>>>
>>
>
>
Previous Topic:rolling back a transaction manually
Next Topic:ecorediag missing classes in packages
Goto Forum:
  


Current Time: Sat Sep 20 09:54:58 GMT 2014

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

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