Community
Participate
Working Groups
Build Identifier: Dali 2.3 / WTP 3.2 For a entity extending from a mapped superclass with an idclass composite key, the JPA validator emits this error message: Description Resource Path Location Type This class has a composite primary key. It must use an ID class. CodeXX.java /JPA1/src/adtek/test line 8 Validation Message The error message occurs for JPA 1.0 and 2.0, and doesn't occur in Dali 2.0.x. Not sure if this is a bug in the Dali 2.3 validator or if it is new validation that wasn't there in Dali 2.0 Reproducible: Always Steps to Reproduce: 1. Create a JPA 1.0 or 2.0 project 2. Copy the attached .java classes into the source folder (mapped super class, entity class, composite key class)
Created attachment 186650 [details] mapped super class
Created attachment 186651 [details] entity class
Created attachment 186652 [details] composite key class
This does appear to be an invalid error message. Will fix for next service release.
Created attachment 187710 [details] Patch This patch will short circuit the offending validation for the Generic case where this is an issue. Other validation will apply in the cases where validation is needed.
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. This is a fix for an invalid error message, and is an adopter issue. Very high priority. * Is there a work-around? If so, why do you believe the work-around is insufficient? No real workaround without turning off all JPA validation. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? JUnit tests have been run. Manual tests have been run. * Give a brief technical overview. Who has reviewed this fix? The validation will now short-circuit if any part of the primary key is defined in a superclass. Some minor refactoring was required to ensure that the fix was applied in all of the proper places (both Entity and MappedSuperclass). Paul has reviewed the fix. * What is the risk associated with this fix? Medium risk, but worth it for high severity issue. Manual and automated tests have been run to ensure that there are no regressions in common usage.
Patch committed to 2.3.x maintenance. Fix also applied to Head.