Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317318

Summary: Canonical Metamodel - removing the @Generated annotation does not prevent Dali from generating the type
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: brian.vosburgh, jolene.moffitt, neil.hauge
Version: 2.3Flags: neil.hauge: review+
Target Milestone: 2.3.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch against head none

Description Karen Butzke CLA 2010-06-18 12:33:04 EDT
1. Create a JPA Project with an Entity Employee.
2. In the Java Persistence Properties select a Source folder for the Canonical metamodel.
3. Edit the Employee_ metamodel class by removing the @Generated annotation.
4. Return to the Employee class and change something.
The Employee_ metamodel class is regenerated.

If you removed the @Generated annotation, closed Eclipse and returned, we correctly do not regenerate the file.  If you then add @Generated(value="Dali") back to the file we still don't regenerate it. You have to delete it to get it regenerated.
Comment 1 Karen Butzke CLA 2010-06-18 16:45:20 EDT
*** Bug 296664 has been marked as a duplicate of this bug. ***
Comment 2 Karen Butzke CLA 2010-06-25 16:10:19 EDT
Created attachment 172807 [details]
proposed patch against head

This patch handles removal of the Generated and StaticMetamodel annotations. It also adds property change notification for these annotations.  Now if you add the @Generated(value="Dali", date="2010-06-25T15:40:04.968-0400") back to the generated file it will be immediately regenerated if changes have been made since the annotation was removed. Before you would have to make a significant change to the context model to get it to regenerate.
Comment 3 Karen Butzke CLA 2010-06-28 15:14:38 EDT
checked in to HEAD for inclusion in 2.3.1 maintenance
Comment 4 Jolene Moffitt CLA 2010-07-22 17:28:07 EDT
Verified this fix in Build wtp-R3.2.1-M: M-3.2.1-20100716070539  Tested manually by removing the @Generated annotation or @StaticMetamodel annotation.  Then closing eclipse, reopen and add the annotation back.  It is regenerated when I add either annotation back.