Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312957 - CCE setting order-by in orm.xml element collection
Summary: CCE setting order-by in orm.xml element collection
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: 2.3 RC2   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 14:27 EDT by Karen Butzke CLA
Modified: 2010-05-26 16:27 EDT (History)
4 users (show)

See Also:
david_williams: pmc_approved+
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved? (neil.hauge)
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: review+


Attachments
proposed patch against head (1.41 KB, patch)
2010-05-14 14:30 EDT, Karen Butzke CLA
no flags Details | Diff
proposed patch against head (1.95 KB, patch)
2010-05-14 16:01 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-05-14 14:27:41 EDT
Use the JPA details view to set Custom ordering on an orm.xml element collection mapping and you get a CCE
Comment 1 Karen Butzke CLA 2010-05-14 14:30:40 EDT
Created attachment 168576 [details]
proposed patch against head

This patch fixes the order-by translator for element collection mappings. Makes it the same as the translator for 1-m and m-m mappings.
Comment 2 Karen Butzke CLA 2010-05-14 15:08:23 EDT
Upping the severity. Once you have set the order-by element on the element collection directly in the source(<order-by>name</order-by>) if you rebuild the project or restart eclipse the orm.xml file won't load because of the exception. Then this actually prevents the JPA project from being built.
Comment 3 Karen Butzke CLA 2010-05-14 16:01:07 EDT
Created attachment 168599 [details]
proposed patch against head

This patch fixes the translator bug and also catches any exception when building JPA files, logs it and continues to the next JPA file instead of failing to build the JPA project.
Comment 4 Karen Butzke CLA 2010-05-14 16:03:30 EDT
Brian could you review this patch?  Pretty simple, but just want to make sure this head cold isn't affecting my coding :)
Comment 5 Brian Vosburgh CLA 2010-05-17 11:17:19 EDT
(In reply to comment #4)
The patch looks reasonable.
Comment 6 Neil Hauge CLA 2010-05-17 17:03:28 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

See comment 2.

* Is there a work-around? If so, why do you believe the work-around is insufficient? 

No workaround.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

Manual and unit tests run.  

* Give a brief technical overview. Who has reviewed this fix? 

Use the appropriate Translator and makes the building of JPA files more robust.

* What is the risk associated with this fix? 

Low risk.  Translator usage matches other similar usage.
Comment 7 Neil Hauge CLA 2010-05-17 17:03:57 EDT
Brian and I have reviewed the fix.
Comment 8 Karen Butzke CLA 2010-05-18 11:26:12 EDT
checked in to HEAD
Comment 9 Paul Fullbright CLA 2010-05-26 12:37:02 EDT
I can't test the fix, since I can't actually set the element collection to use custom ordering using the details pane.

When I attempt to set custom ordering, the <order-by></order-by> tags are added (not sure that's exactly the right tag, but something is happening) but the Primary key radio button is also selected and the custom ordering text field is still disabled.

Did this fix also cause this problem?
Comment 10 Karen Butzke CLA 2010-05-26 13:26:40 EDT
I should have pointed to bug 190866 since that covers the remaining issue. This bug was purely to fix the CCE so you actually are testing the fix if you aren't seeing the CCE and if the use case in comment #2 works.  The UI issues do appear to have gotten worse so we should probably make another attempt at fixing 190866 in the next release.  I have not figured out how to get the translators to work for this case, Paul maybe you will have some luck with that?  Or if it's not possible it's one reason for us to remove our use of translators.
Comment 11 Paul Fullbright CLA 2010-05-26 16:27:32 EDT
Re-resolving as I now understand better the steps to reproduce.
Comment 12 Paul Fullbright CLA 2010-05-26 16:27:54 EDT
verified no cce's in RC2