I have the following Scheme
@Entity
public class A
{
@Id
String field1
String field2
}
public class B extends A
{
String field3;
@OneToMany(MappedBy="b")
List<C> cList;
}
public class C extends A
{
String field4;
@ManyToOne
B b;
}
Both class B and C extends A and get their id From A using table per concrete class strategy but the problem is that class B has one to many relationship with class C so what i want is to change the id of class C to be a composite key consist of the inherited id field1 and the id of the object b. That will allow two different object of b to have the two different object of c with the same field1 value. Is what i am thinking possible (override inheritance) i am using eclipse link as persistence provider.