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

Bug 283897

Summary: [JPA 2.0] Generation and updating of canonical metamodel
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: GeneralAssignee: Brian Vosburgh <brian.vosburgh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: karenfbutzke, shaun.smith
Version: unspecifiedKeywords: plan
Target Milestone: 2.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard: JPA2.0

Description Neil Hauge CLA 2009-07-17 17:08:31 EDT
A nice feature for Dali would be the ability to generate and maintain the canonical metamodel described in the JPA 2.0 spec.  These static metamodel classes can be used in the definition of criteria queries, which means that in order for the canonical model to be really useful, it has to be up-to-date with the latest code.  Dali could keep the canonical model up-to-date by listening to the existing Dali JPA model, which is always in sync with the latest committed code.

Questions that need to be resolved:
- When does the code get initially generated?
- At what point is the metamodel updated?
- What UI do we need to help users configure this?  What are the configuration options we would want to provide?
Comment 1 Neil Hauge CLA 2009-09-21 13:04:11 EDT
Metamodel generation is currently functional (in a dev environment), but without preferences, and by running after our last model "update" is complete for a given change.  

Remaining work items for M3 include:
- adding project preferences to control generation (and to achieve parity with the EclipseLink implementation)
- making the update process more fine grained, instead of operating in batch fashion (this could be deferred from 3.0 if we need additional resources for other JPA 2.0 support)
- adjust Generated comment to align with EclipseLink's comment
Comment 2 Brian Vosburgh CLA 2009-11-06 11:14:50 EST
Closing this bug, as the main portion of work is complete. Any outstanding issues will be handled with separate bugs.

Metamodel generation is activated by selecting a source directory on the JPA Project Properties page. Conversely, it is de-activated by de-selecting the directory. The metamodel source is re-calculated whenever any JPA setting is modified; but only files that have changed since the last time they were generated are overwritten.