Hello,
Here is the class model, namely that we can reference either ActorEcore or Actor which forces me to define them both as @Entity.
The problem is that by doing this, as the two tables are persisted in the same table I have this error:
org.hibernate.AnnotationException: Foreign key circularity dependency involving the following tables: TACTEUR, TACTEUR
Here he proposes to change the inheritance strategy to SINGLE_TABLE and to use @SecondaryTable but it is not very simple because it forces to redefine all the attributes to declare the secondary table used
@Entity
@Table(name = "TACTEUR")
@Inheritance(strategy = JOINED)
@DiscriminatorColumn(name = "ROLE", length = 80)
public abstract class ActeurEcore
@Entity
public abstract class Acteur extends ActeurEcore
@MappedSuperclass
@Table(name = "TPERSONNEMORALE")
public abstract class PersonneMorale extends Acteur
@Entity
@Table(name = "TAGENCEBANCAIRE")
@DiscriminatorValue("com.hermes.ref.acteur.businessobject.AgenceBancaire")
@GenerationParameter(value = "com.hermes.ref.acteur.businessdao.ActeurDAO")
public class AgenceBancaire extends PersonneMorale