users@glassfish.java.net

2 Embedded of same class in one entity?

From: <glassfish_at_javadesktop.org>
Date: Thu, 07 Aug 2008 06:01:08 PDT

Hello

Here is the problem (simplified):
---------------------------------------------------
@Embeddable
class Version {
String vname;
....
}

@Entity MyObject {
@Embedded
Version majorVersion;

@Embedded
Version minorVersion;
}
---------------------------------------------------

As you can guess the property names (such as 'vname') of the Version class clash because Version is embedded twice.

I know I can do a OneToMany etc etc way but that is not a preferred option. Is there a way around this problem?

Thanks in advance
[Message sent by forum member 'marlor' (marlor)]

http://forums.java.net/jive/thread.jspa?messageID=292121