Bug 336296 - [API] Validation for virtual attributes does not currently work
Summary: [API] Validation for virtual attributes does not currently work
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords: api
Depends on:
Blocks:
 
Reported: 2011-02-03 18:45 EST by Neil Hauge CLA
Modified: 2011-05-11 11:02 EDT (History)
1 user (show)

See Also:
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)


Attachments
patch 1a (313.71 KB, patch)
2011-05-11 11:02 EDT, Brian Vosburgh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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).