Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Error: Dali not correctly validating @EmbeddedId ID classes
Error: Dali not correctly validating @EmbeddedId ID classes [message #671905] Thu, 19 May 2011 10:18 Go to next message
Karsten Wutzke is currently offline Karsten WutzkeFriend
Messages: 124
Registered: July 2009
Senior Member
Hello,

I have the following entity and ID class:

@Entity
@Table(name = "Groups")
@Name(value = "group")
public class Group implements Serializable
{
	@EmbeddedId
	private GroupId embeddedId;

	...
}

@Embeddable
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?

Karsten
Re: Error: Dali not correctly validating @EmbeddedId ID classes [message #671912 is a reply to message #671905] Thu, 19 May 2011 10:35 Go to previous message
Karsten Wutzke is currently offline Karsten WutzkeFriend
Messages: 124
Registered: July 2009
Senior Member
Bug reported here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=346413
Previous Topic:JPA Tools -> Entity from Tables
Next Topic:entity not generated for 1 table (sql server 2008)
Goto Forum:
  


Current Time: Thu Apr 25 05:04:08 GMT 2024

Powered by FUDForum. Page generated in 0.03132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top