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

Bug 326973

Summary: TABLE_PER_CLASS with EmbeddedId results in DescriptorException EclipseLink-74 "The primary key fields are not set for this descriptor"
Product: z_Archived Reporter: Chris Delahunt <christopher.delahunt>
Component: EclipselinkAssignee: Guy Pelletier <guy.pelletier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: douglas.clarke, eclipselink.orm-inbox, guy.pelletier, schmidt, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
test case. Rebuild and run the TablePerClassInheritanceTestSuite
none
Proposed changes none

Description Chris Delahunt CLA 2010-10-04 17:25:15 EDT
Created attachment 180212 [details]
test case.  Rebuild and run the TablePerClassInheritanceTestSuite

Using an EmbeddedId on classes using @Inheritance(strategy=TABLE_PER_CLASS) causes 

Exception [EclipseLink-74] (Eclipse Persistence Services - 2.2.0.qualifier): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this descriptor.
Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.jpa.inheritance.IndirectElimination --> [DatabaseTable(TPC_IND_ELIMINATION)])

Exception [EclipseLink-74] (Eclipse Persistence Services - 2.2.0.qualifier): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this descriptor.
Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.jpa.inheritance.DirectElimination --> [DatabaseTable(TPC_DIR_ELIMINATION)])

Runtime Exceptions: 
---------------------------------------------------------

	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:471)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:667)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:628)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:230)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:392)
	... 17 more

reproduction based on existing EclipseLink tests is attached using the inheritance JPA test model, specifically modifying the 
org/eclipse/persistence/testing/mod els/jpa/inheritance/Elimination.java
class.
Comment 1 Doug Clarke CLA 2010-10-10 20:22:50 EDT
Is this just based on project development testing or does it effect user.
Comment 2 schmidt CLA 2010-10-11 09:40:45 EDT
I have the same issue. This bug is very critical to me as im porting a working application from JBoss to Equinox and I cannot change the mapping or class model. This bug effectively makes the porting to Equinox using Eclipse Link impossible to me.
Comment 3 Tom Ware CLA 2010-10-15 11:00:43 EDT
Targetting for 2.2.  We will take a look at this in the next few days and assuming the fix is fairly straight-forward, we will check in a fix (else we will add some comments)
Comment 4 Guy Pelletier CLA 2010-10-18 10:20:42 EDT
Created attachment 181100 [details]
Proposed changes
Comment 5 Guy Pelletier CLA 2010-10-18 10:51:33 EDT
Changes have been submitted.

Reviewed by: Chris Delahunt

Added new model to the inheritance package. With fix in place, metadata processing completes without errors and the full regression and extended tests all pass.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:10:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink