Joined: Sun Jul 06, 2008 7:05 pm Posts: 6
|
Hi,
I want to always refer to the IdClass when referencing an entity instead of utilizing its entity class. For various reasons this makes the object nice for serialization and communication.
My first most obvious concern is that I map as an entity the embeddable class that is also the IdClass of the original class. It works but i have to look at this in more detail.
Does anyone have any resources about the mapping of multiple entities to the same table?
Does anyone have any resources about the usage of mapped entities as embeddable classes?
Thanks
-Tim
public class Alpha {
...
@ManyToOne
@JoinColumn(name="beta_id")
public BetaPk getBeta()
...
}
@Entity
@IdClass(BetaPk.class)
@Table(name="beta")
public class Beta
@Embeddable
@Entity
@Table(name="beta")
public class BetaPk implements Serializable
|
|