Community
Participate
Working Groups
Build Identifier: This bug can be reproduced with EclipseLink-2.3.0. If an Embeddable derives from an Embeddable which has an Embedded property, this Embedded property will not be mapped. It will be mapped when the superclass Embeddable is used, thus this is a problem in the implementation of bug 283028. Suppose the following constellation: An Embeddable "Primitive" defines a field "field". An Embeddable "BasicEmbeddable" has a property of type "Primitive", which is annotated with Embedded. An Embeddable "ExtendedEmbeddable" inherits from "BasicEmbeddable". An Entity "TheEntity" contains "ExtendedEmbeddable". The resulting table will NOT contain the field "field". To simplify this a bit: TheEntity refers to ExtendedEmbeddable inherits from BasicEmbeddable refers to Primitive I will attach a test case with which the problem can be reproduced. Reproducible: Always Steps to Reproduce: 1. Extract test case and create a corresponding persistence.xml 2. Generate tables or do whatever is necessary to inspect the mappings 3. Notice that theentity only has a field "test", and is missing the field "field"
Created attachment 206067 [details] Test case to reproduce the problem
I think your issue lies in the double declaration of BasicEmbeddable, that is: @Embeddable @MappedSuperclass public class BasicEmbeddable The class can't be both an Embeddable and a MappedSuperclass. You should remove the @Embeddable declaration and have only the @MappedSuperclass.
(In reply to comment #2) > I think your issue lies in the double declaration of BasicEmbeddable, that is: > > @Embeddable > @MappedSuperclass > public class BasicEmbeddable > > The class can't be both an Embeddable and a MappedSuperclass. You should remove > the @Embeddable declaration and have only the @MappedSuperclass. Doesn't matter. You can remove the @Embeddable, and the behavior is still the same. Column "field" is still missing. On PostgreSQL: CREATE TABLE theentity ( id integer NOT NULL, test integer );
Outside of a DDL generation issue, is the mapping not available from the descriptor? That is, if you create the tables yourself are you able to persist TheEntity successfully? Just trying to narrow down your issue. Have you tried moving the @Embedded mapping from BasicEmbeddable to ExtendedEmbeddable? Same issue?
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink