Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323850 - Primary key metadata issues
Summary: Primary key metadata issues
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 11:42 EDT by Guy Pelletier CLA
Modified: 2022-06-09 10:19 EDT (History)
2 users (show)

See Also:


Attachments
Porposed changes (29.18 KB, patch)
2010-10-27 15:44 EDT, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Pelletier CLA 2010-08-27 11:42:35 EDT
I came across a couple issues in the PrimaryKeyMetadata class.

1 - The cacheKeyType is never read from the annotations. The following line should be added to the constructor for annotation processing:

m_cacheKeyType = (String) primaryKey.getAttribute("cacheKeyType");

2 - in the process method, the wrong validation exception is thrown if the user does not specify a name on one of the primary key columns, that is:

ValidationException.optimisticLockingSelectedColumnNamesNotSpecified(descriptor.getJavaClass());

A new exception should be created as this one does not make sense in this context and would be very confusing to the user.

Also, is the usage of a @PrimaryKey exclusive, in that it should not be used in conjunction with other JPA id mappings (@Id, @EmbeddedId, @IdClass, derived id's)? I suspect it does not make any sense for most but I don't see anything preventing users from doing this.
Comment 1 Tom Ware CLA 2010-09-13 10:33:13 EDT
Setting target and priority.  See the following page for information about what these settings mean:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Guy Pelletier CLA 2010-10-27 10:21:06 EDT
I already corrected the first point in a previous transaction. I'll include a patch to correct the second point shortly.
Comment 3 Guy Pelletier CLA 2010-10-27 15:44:37 EDT
Created attachment 181871 [details]
Porposed changes
Comment 4 Guy Pelletier CLA 2010-10-27 16:01:06 EDT
Changes have been submitted.

Reviewed by: Chris Delahunt

Manually tested to verify the exception and new model change/addition to fieldaccess.advanced to test pk metadata override of mapped superclass.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:19:47 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink