|Error: Dali not correctly validating @EmbeddedId ID classes [message #671905]
||Thu, 19 May 2011 06:18
| Karsten Wutzke
Registered: July 2009
I have the following entity and ID class:
@Table(name = "Groups")
@Name(value = "group")
public class Group implements Serializable
private GroupId embeddedId;
public class GroupId implements Serializable
@Column(name = "round_id")
private Integer roundId;
@Column(name = "ordinal_nbr")
private Integer ordinalNbr = 1;
The Group class has two columns, both being PK columns. Nothing special really. However, Dali shows an error
"Class GroupId is mapped, but is not included in any persistence unit"
I know I should use the quick fix to include the ID class in persistence.xml, but AFAIK ID classes don't belong there.
This should be a bug, also because using @IdClass mappings instead of @EmbeddedId works in Dali without problems. This error only occurrs with @EmbeddedId mappings.
The problem here seems to be the @Embeddable on the ID class. Removing it removes the Dali error. However, it's not correct to remove the @Embeddable. See here to confirm my mappings should be correct: http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Embedded_Id
So, is this a bug?
Powered by FUDForum
. Page generated in 0.14264 seconds