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

Bug 336296

Summary: [API] Validation for virtual attributes does not currently work
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: GeneralAssignee: Brian Vosburgh <brian.vosburgh>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: david_williams
Version: 3.0Keywords: api
Target Milestone: 3.0 M7Flags: david_williams: pmc_approved+
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved? (neil.hauge)
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: pmc_approved? (cbridgha)
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch 1a none

Description Neil Hauge CLA 2011-02-03 18:45:35 EST
As a result of the recent refactoring work, virtual attribute mapping validation is no longer displayed in the ORM XML.  The AstractOrmAttributeMapping.isVirtual() check should indicate where certain validation is no longer working.
Comment 1 Neil Hauge CLA 2011-04-26 09:14:51 EDT
This is a major bug surrounding our validation of "virtual" mappings they are implied by the spec but not actually represented in source.  This is a regression and has been worked on for a number of weeks.  I am requesting PMC approval for this minor provisional API change.
Comment 2 David Williams CLA 2011-04-26 10:52:35 EDT
I'm fine with this, but its not clear what the change is, exactly. change in behavior? Change in arguments? return type? Is is a change from last release? Or just from previous milestone?
Comment 3 Neil Hauge CLA 2011-04-26 11:25:14 EDT
(In reply to comment #2)
Sorry...forgot to provide a link to the change details:

http://dev.eclipse.org/mhonarc/lists/dali-dev/msg01159.html
Comment 4 Neil Hauge CLA 2011-04-27 23:48:53 EDT
This change has been committed and will soon be released to head.  Brian, please post a patch if possible for historical purposes.
Comment 5 Brian Vosburgh CLA 2011-05-11 11:02:59 EDT
Created attachment 195369 [details]
patch 1a

This patch fixes a number of validation problems via the following changes:

- A rework of the Validator hierarchy, which is internal to Dali.

- Changes to all the Java clients of the Validators to pass in a persistent attribute. This allows a Validator to determine whether the mapping (etc.) is "virtual".

- Complete re-work of generators and queries, which don't fit the "virtual" model since they are not necessarily overridden by mapping file generators and queries.

- A couple of very minor public API changes were necessary so generator and query validation could be moved to the persistence unit:
  - All the sub-interfaces of PersistentTypeContainer declared the method getPersistentType(String name) and it was necessary to move that method up to PersistentTypeContainer.
  - MappingFileRoot did not extend PersistentTypeContainer and it should have. We did not notice this before since OrmXml, the *only* sub-interface of MappingFileRoot, extended PersistentTypeContainer and we were sloppily casting to OrmXml when necessary (instead of using MappingFileRoot directly).