[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] Embeddables and inheritance
|
The specification says, with regard to
@Embeddable classes:
Embeddable classes must adhere to the requirements specified in Section 2.1 for entities with the exception
that embeddable classes are not annotated as Entity.
Section 2.1.9, a sub-section of Section 2.1, and therefore included by it, includes the stanza:
An entity may inherit from another entity class.
That tells me that
@Embeddables should be allowed to inherit from one another in exactly the same way that entities are allowed to inherit from one another.
I have one
@Embeddable class (
GeneralLedgerAccountIdentifier) that inherits from another (
GeneralLedgerAccountType), and, at the moment, adds no additional state information (so no additional persistent fields, although I plan to add some later). I have another class that uses this
@Embeddable as its primary key, via the
@EmbeddedId annotation.
EclipseLink (1.1.2-SNAPSHOT) bombs out and says:
Exception Description: Entity [class ljn.GeneralLedgerAccount] uses [class ljn.GeneralLedgerAccountIdentifier] as embedded id class whose access-type has been determined as [FIELD]. But [class ljn.GeneralLedgerAccountIdentifier] does not define any [FIELD]. It is likely that you have not provided sufficient metadata in your id class [class ljn.GeneralLedgerAccountIdentifier].
Neither OpenJPA nor Hibernate have a problem with this particular construction and work properly in my opinion.
Should I file a bug, or is there a nuance in the specification I am not aware of that governs this case?
Thanks,
Laird