Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370716 - [Texo] No solution to move the 'mapped-by' attribute from the default side of a one-to-one to the other side
Summary: [Texo] No solution to move the 'mapped-by' attribute from the default side of...
Status: RESOLVED FIXED
Alias: None
Product: EMFT
Classification: Modeling
Component: Texo (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 08:31 EST by Benoit Cantin CLA
Modified: 2012-02-13 04:29 EST (History)
1 user (show)

See Also:


Attachments
First use case (8.18 KB, application/zip)
2012-02-06 08:32 EST, Benoit Cantin CLA
no flags Details
Second use case (8.34 KB, application/zip)
2012-02-06 08:32 EST, Benoit Cantin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benoit Cantin CLA 2012-02-06 08:31:40 EST
Build Identifier: 

When 2 one-to-one relations are set as opposite, Texo generates a 'mapped-by' attribute on one side of this bi-directional relation. But the user can't control which side declares the attribute 'mapped-by', even through the use of the annotation model.

I suggest 2 things :
- first, if the user declares a one-to-one ORM annotation in the annotation model, and if he lets the 'mapped by' property blank, then Texo should not generate the 'mapped-by' attribute (Texo should consider that the user wants not to generate the 'mapped-by' attribute).
- second, if one side of the bi-directional relation declares a composition, then the 'mapped-by' attribute should be - by default -generated on the side not declaring this composition.

Cf. attached use cases :
- UseCase3-1.zip : the annotation model does not declare ERelations with ORM annotation One to one. 'mapped-by' is generated in Class1 while Class1 instances are compound of Class2 instances. I would have put 'mapped-by' in Class2.

- UseCase3-2.zip : now I have annotated my 2 ERelations in the annotation model. In Class1, I let the 'mapped by' property blank, with the idea that Texo will not generate this attribute. In Class2, I specify the value 'toClass2' in the 'mapped-by' property. I get a 'mapped-by' attribute in both classes which prevent me from customizing the side on which the 'mapped-by' attribute is generated.

Reproducible: Always
Comment 1 Benoit Cantin CLA 2012-02-06 08:32:23 EST
Created attachment 210576 [details]
First use case
Comment 2 Benoit Cantin CLA 2012-02-06 08:32:45 EST
Created attachment 210577 [details]
Second use case
Comment 3 Benoit Cantin CLA 2012-02-06 08:36:08 EST
My Texo version is 0.1.0.v201201301114.
Comment 4 Martin Taal CLA 2012-02-13 04:29:44 EST
Available in latest published build