Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367249 - NPE with JOINED inheritance and primary key TenantDiscriminatorColumn
Summary: NPE with JOINED inheritance and primary key TenantDiscriminatorColumn
Status: NEW
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: Project Inbox CLA
QA Contact:
URL:
Whiteboard: multitenancy
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 15:54 EST by Karen Butzke CLA
Modified: 2022-06-09 10:04 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-12-20 15:54:32 EST
Using EclipseLink version 2.4.0.v20111209-r10529

Given this JOINED inheritance example with a primaryKey TenantDiscriminatorColumn I hit the following NPE while EclipseLink is processing the metadata.

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Multitenant(value=MultitenantType.SINGLE_TABLE)
@TenantDiscriminatorColumn(name="TENANT_ID", primaryKey=true)
public class Foo {
    @Id
    private int id;
}

@Entity
public class SubFoo extends Foo {

}


Caused by: java.lang.NullPointerException
	at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.setPKClass(MetadataDescriptor.java:1738)
	at org.eclipse.persistence.internal.jpa.metadata.inheritance.InheritanceMetadata.process(InheritanceMetadata.java:237)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processTableAndInheritance(EntityAccessor.java:1202)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:618)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1645)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:532)
	at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:546)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1356)
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:04:28 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink