Bug 235384

Summary: generate jpa entities without persistence.jar on classpath causes model problems
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: 2.0Flags: neil.hauge: review+
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 174513    
Bug Blocks:    
Attachments:
Description Flags
proposed patch - HEAD - partial fix none

Description Karen Butzke CLA 2008-06-03 12:20:15 EDT
Create a new jpa project and don't specify an implementation library (no persistence.jar on your classpath).  Generate some entities from your database and notice all the java compile errors because the javax.persistence classes are not in your classpath.  Add the persistene.xml java to your classpath and the project now has no errors.  The project should include errors for each java file because they are not listed in the persistence.xml.

Doing a project validate or even a clean does not show these errors. If you actually open one of the java files in to the java editor and then validate it, you will get the error.  The files are not making it in to our jpa model until they are opened in the editor. You can watch this happening if you expand the JPA content  in the project explorer. As you open a java file in the editor, it will appear under your persistence unit.
Comment 1 Neil Hauge CLA 2008-06-10 16:31:12 EDT
Candidate for 2.0.1.
Comment 2 Karen Butzke CLA 2008-06-12 14:59:19 EDT
This bug is partially dependent on bug 174513.  We need to make sure a jpaProject.update() is called when the classpath changes and we also need the JpaValidator called (which is the part bug 174513 would do for us)
Comment 3 Karen Butzke CLA 2008-06-16 09:51:35 EDT
Created attachment 105021 [details]
proposed patch - HEAD - partial fix

The attached patch partially fixes this bug, it makes sure our model is appropriately updated on classpath changes.  A project validate will now show the errors.  When the blocking bug is fixed the validate will occur automatically when a classpath change occurs
Comment 4 Karen Butzke CLA 2008-07-21 17:16:55 EDT
checked in to HEAD