Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353149 - [Metadata Conversion] Support moving JPA global metadata to XML
Summary: [Metadata Conversion] Support moving JPA global metadata to XML
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Nan Li CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks: 138622
  Show dependency tree
 
Reported: 2011-07-26 14:25 EDT by Nan Li CLA
Modified: 2012-03-07 21:13 EST (History)
3 users (show)

See Also:
brian.vosburgh: review+


Attachments
patch (290.33 KB, patch)
2011-09-12 17:20 EDT, Nan Li CLA
no flags Details | Diff
patch (290.46 KB, patch)
2011-09-14 17:10 EDT, Nan Li CLA
no flags Details | Diff
patch (291.21 KB, patch)
2011-09-22 14:55 EDT, Nan Li CLA
no flags Details | Diff
Patch (350.56 KB, patch)
2011-11-10 09:21 EST, Nan Li CLA
no flags Details | Diff
proposed patch (347.89 KB, patch)
2012-02-22 14:25 EST, Nan Li CLA
no flags Details | Diff
proposed patch (416.93 KB, patch)
2012-03-07 17:09 EST, Nan Li CLA
brian.vosburgh: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Li CLA 2011-07-26 14:25:08 EDT
Build Identifier: I20110526-1708

Need support for moving global metadata to XML. 

Global metadata:

1) Generic platform: queries, generators
2) EclipseLink platform: queries, generators, converters

This is a part of JPA metadata conversion function requested in bug 138622.

Reproducible: Always
Comment 1 Nan Li CLA 2011-09-12 17:20:12 EDT
Created attachment 203192 [details]
patch

This patch is not ready for check-in due to the fix of the NPE happening when removing nested annotation is a bit hacky. Brain is looking at the related issues to find a better way to fix that problem, but I still upload the patch anyway to let Neil and Brain test and take a look at my code and give me some feedback.
Comment 2 Neil Hauge CLA 2011-09-14 13:23:55 EDT
Feedback on patch:  ( ... -> ... indicates a suggested text change)

- Would be nice if "Move to XML..." was at the end of the JPA Tools menu, as opposed to being first.

- [Warning]: Malformed metadata will cause disfunctional mapping file XML ->
[Warning]: Malformed annotations will result in non-functional XML mapping file.

- And duplicated or overridden JPA global metadata will not be moved to XML. ->
Duplicated or overridden annotations will not be moved to XML.

- It's interesting that the java file format isn't restored after removing annotations.  This isn't a big deal, but something to look into.


Other than that, it seems to be working nicely and as expected.
Comment 3 Nan Li CLA 2011-09-14 17:10:22 EDT
Created attachment 203368 [details]
patch

Incorporated the comments.

- Would be nice if "Move to XML..." was at the end of the JPA Tools menu, as
opposed to being first.

I couldn't find a way to do this. One comment in bug 324161 says
------------
> The confusion arises from the fact that other items in the same logical group 
> are added using actionSets, and actionSets are processed after 
> menuContributions - I think this is wrong (and should probably be fixed along 
> with bug 324160 ?) 
 
No, this is by design.  actionSets (all action extension points) are applied 
after programmatic contributions and menuContributions.  
-----------
The menu items I added are menu contributes while the previous ones are objectContributions/actions, so we may need to leave "Move to XML" as it is. Let me know if I misunderstand this.

- It's interesting that the java file format isn't restored after removing
annotations.  This isn't a big deal, but something to look into.

I couldn't reproduce this. Let me know if you see it again. Thanks!
Comment 4 Nan Li CLA 2011-09-22 14:55:52 EDT
Created attachment 203857 [details]
patch

Changed to perform JPA metadata conversion operation through ProgressMonitorDialog instead of WorkspaceJob.
Comment 5 Neil Hauge CLA 2011-09-22 16:38:08 EDT
This enhancement is being re-targeted to M3 as there was an underlying concurrency issue that was causing some problems.  This should be resolved soon and this enhancement can then go into Head after a final review.
Comment 6 Neil Hauge CLA 2011-11-03 17:59:58 EDT
The concurrency issue mentioned in comment 5 has not yet been fully resolved, and the IP Log had to be submitted to get a review completed in time for a Nov 23rd release.  As a result, this feature will unfortunately have to wait until 3.2.
Comment 7 Nan Li CLA 2011-11-10 09:21:14 EST
Created attachment 206786 [details]
Patch

incorporated with Brain's code
Comment 8 Nan Li CLA 2012-02-22 14:25:35 EST
Created attachment 211442 [details]
proposed patch

incorporated with the latest head code
Comment 9 Nan Li CLA 2012-03-07 17:09:21 EST
Created attachment 212259 [details]
proposed patch
Comment 10 Brian Vosburgh CLA 2012-03-07 17:39:06 EST
Reviewed and checked into HEAD.