Community
Participate
Working Groups
When creating a new bundle project with JPA enabled persistence.xml is placed in src/META-INF however it should be placed in the Project Root/META-INF alongside the MANIFEST.MF. Since the Helios release Dali has been placing persistence.xml in /META-INF when converting a plug-in project to a Faceted project with a JPA facet.
Created attachment 194824 [details] fix With this patch the META-INF folder changes its place from 'src' folder to root. There is a side effect from this - sometimes validation gets confused and shows error in the problems view but manual project clean or validate removes it. I guess it comes from validation synchronization I guess the above should result in a bug after this patch is committed.
Created attachment 196967 [details] reworked patch - changed taking the source folder and computing the destination folder way
Dimitar, thanks for the patch. There is a known issue with creating patches with EGit, which prevents applying the patch. Could follow these instructions and push your patch to a GitHub repo? http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions Thanks!
here it is: https://github.com/dgiormov/LibraPatches/commit/ec73fa00d35f5c0adc6722e426123edb78eb2eec
Unfortunately, this patch does not work properly. Simply moving the persistence.xml from /src/META-INF to /META-INF breaks the JPA model and Dali tools (like the JPA Diagram Editor) cannot work properly.
After spending some time, it turned out that the patch works properly only when creating new JPA project without Utility facet. I succeeded to modify it to cover this case too. The only scenario left is when converting existing JPA project to OSGi Bundle - I am looking to a way to refresh the JPA model without having any error markers on the persistence.xml file...
Refreshing the JPA model seems to be a tough thing. I decided to commit the current work in Git and open a separate bug for converting existing JPA project to a Persistent Bundle. The following change is committed in the indigo branch and merged to master: http://git.eclipse.org/c/libra/org.eclipse.libra.git/commit/?id=338c8f6178c820789dd34bebcb3324db32ef1bcb
I opened bug 352121 for converting existing JPA project to a Persistent Bundle.
Tests are available here: https://github.com/asilgidjian/libra/commit/6ef5cbe3fca0df16c1106f3f3aa33678b587fec2 Kind Regards, Alex
Thanks for the tests, Alex. They are now pushed to the indigo branch.
Verified with the latest build from http://download.eclipse.org/libra/maintenance/snapshot/
Closing