Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345923 - targetEntity property affects correct resolving of a relation
Summary: targetEntity property affects correct resolving of a relation
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Diagram Editor (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Stefan Dimov CLA
QA Contact: Stefan Dimov CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 07:48 EDT by Stefan Dimov CLA
Modified: 2011-05-23 19:28 EDT (History)
3 users (show)

See Also:
david_williams: pmc_approved+
stefan.dimov: pmc_approved? (raghunathan.srinivasan)
stefan.dimov: pmc_approved? (naci.dai)
stefan.dimov: pmc_approved? (deboer)
stefan.dimov: pmc_approved? (neil.hauge)
stefan.dimov: pmc_approved? (kaloyan)
stefan.dimov: pmc_approved? (cbridgha)
petya.sabeva: review+
stefan.dimov: review+
neil.hauge: review+


Attachments
patch (1.09 KB, patch)
2011-05-16 11:28 EDT, Stefan Dimov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Dimov CLA 2011-05-16 07:48:55 EDT
Editor is unable to resolve relationships with targetEntity property of the mapping attribute:

1. Create two entities
2. Create one-to-one relation between them
3. Add targetEntity property to the mapping attribute of the owner entity
4. Remove and readd one of the entities to the diagram

Result: The relationship is not visualized.

If you remove the targetEntity property and repeat step #4 the relation will reappear
Comment 1 Stefan Dimov CLA 2011-05-16 11:28:34 EDT
Created attachment 195743 [details]
patch
Comment 2 Stefan Dimov CLA 2011-05-17 06:04:50 EDT
This defect doesn't represent correctly the diagram. If the user uses the targetEntity propert she won't be able to see the relations in the diagram. That's why I believe that this patch should get into RC2.

The only workaround I can think of is to remove the targetEntity property in order to see the relation, which is not much of a workaround, so it shouldn't be considered seriously.

The fix was tested manually. All the existing JUnit tests are passing successfully.

This bug is because in the editor code is used incorrectly the method RelationshipMappingAnnotation.getTargetEntity() instead of RelationshipMappingAnnotation.getFullyQualifiedTargetEntityClassName() and later on a certain string comparison returns false. Petya reviewed the fix.

The change is very small - in one place just the correct method is invoked, so the risk is very low.
Comment 3 Stefan Dimov CLA 2011-05-18 04:25:58 EDT
patch committed and released
Comment 4 Stefan Dimov CLA 2011-05-18 04:26:15 EDT
.