|Compatibility of TABLE_PER_CLASS inheritance strategy with composite keys [message #630514]
||Sun, 03 October 2010 12:44
Registered: October 2010
Is there any (JPA) defined incompatibility between the TABLE_PER_CLASS inheritance strategy and the use of composite key?
With the following entities:
- BaseId: embeddable entity (to be used as embedded id)
- Base: base class, whose embedded id is BaseId and inheritance strategy is TABLE_PRE_CLASS
- Derived1: class derived from Base
EclipseLink (2.1.1) fails throwing an exception:
Exception [EclipseLink-74] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this descriptor.
Descriptor: RelationalDescriptor(jpa03.Derived1 --> [DatabaseTable(DERIVED1)])
However, changing the Base key from BaseId to any simple primary key (e.g. int), things work correctly.
So, is this a JPA limitation or an EclipseLink limitation / bug?
I have read that TABLE_PER_CLASS is optional, so it may well be an EclipseLink limitation, but I did not find any explicit statement about this.
Powered by FUDForum
. Page generated in 0.02977 seconds