Code:
@Entity
public class Company
implements Serializable
{
@Id
private Long id;
@Column(nullable = false, unique=true)
private String name;
public Company()
{
}
getter .. setter...
}
@Embeddable
public class Apk
implements Serializable
{
@ManyToOne(optional = false)
private Company company;
@NotNull
@Column(nullable = false)
private Long id;
public Apk()
{
}
getters.. setter...
}
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class A
implements Serializable
{
@Id
private Apk id;
private String jpt;
public A()
{
}
}
@Entity
@DiscriminatorValue(value="B")
public class B
extends A
implements Serializable
{
public B()
{
}
}
whats wrong with my code??? it throws
org.hibernate.MappingException: Foreign key (FK42C56CD972:B [id])) must have same number of columns as the referenced primary key (A [company_id,id])