I have this 3 entities E1, E2, E3. I want to know how I must note my E3 class has 2 primary key each pointing to a different table with additional fields.
@Entity
public class E1 extends RAP{
/**
*
*/
}
@Entity
public abstract class E2{
/**
*
*/
}
E3 class has 2 primary keys pointing to e1 and e2.
@Entity
public class E3 extends RAP{
@Id
@ManyToOne
@JoinColumn(name = "e1_id")
private E1 e1;
@Id
@ManyToOne
@JoinColumn(name = "e2_id")
private E2 e2;
private Double myfield1;
private Double myfield2;
}
but there is a problem. like this...
This class has a composite primary key. It must use an ID class.
so i want to use some annotation without using @Embedded entity