Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366704

Summary: Incorrect exception on Structure mapping that is an array of Embeddables
Product: z_Archived Reporter: Karen Butzke <karenfbutzke>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2011-12-14 09:46:34 EST
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)
Comment 1 Karen Butzke CLA 2011-12-14 09:52:19 EST
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
Comment 2 Karen Butzke CLA 2011-12-15 08:53:48 EST
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.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:08:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:16:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink