Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366704 - Incorrect exception on Structure mapping that is an array of Embeddables
Summary: Incorrect exception on Structure mapping that is an array of Embeddables
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-14 09:46 EST by Karen Butzke CLA
Modified: 2022-06-09 10:16 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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