Community
Participate
Working Groups
I am using EclipseLink build eclipselink-2.4.0.v20111118-r10419 The following example results in the exception below when processing the metadata. As you can see, Bar *is* an Embeddable. I have no orm.xml file in this project @Entity public class Foo { @Id private int id; @Structure private Bar[] bars; } @Embeddable public class Bar { private int asdf; } Exception Description: The Entity class [class model.Foo] has an embedded attribute [bars] of type [class [Lmodel.Bar;] which is NOT an Embeddable class. Probable reason: missing @Embeddable or missing <embeddable> in orm.xml if metadata-complete = true at org.eclipse.persistence.exceptions.ValidationException.invalidEmbeddedAttribute(ValidationException.java:2417) at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.processMappingAccessors(MetadataDescriptor.java:1423) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.processMappingAccessors(ClassAccessor.java:1482)
Using a Collection of Bars I get the same exception: Exception Description: The Entity class [class model.Foo] has an embedded attribute [bars] of type [class java.util.Collection] which is NOT an Embeddable class. Probable reason: missing @Embeddable or missing <embeddable> in orm.xml if metadata-complete = true
I believe I am incorrectly using the Structure annotation in this example, should just have a field private Bar bar. But anyway, we could give better assistance in this case.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink