假设我有两个带有可嵌入/复合键的实体类... 例如
@Entity
public class X
{
@EmbeddedId private Embed id;
......
@Embeddable public class Embed
{
private int a;
private int b;
.......
@Entity
public class Y
{
@EmbeddedId private YEmbed id;
......
@Embeddable public class YEmbed
{
private int a1;
private int b1;
.......
现在在上述情况下,我想定义某种映射,例如使用组合键字段a与a1或b与b1与OnetoOne或ManytoOne或表X和Y之间的任何其他映射???
如何在spring-jpa / hibernate中实现这一目标?
提前谢谢。...