1
I have the following relationamento
In the Definition Scale entity I have a composite primary key
composed of idEscalaDetailing and idTurma
I’m having doubts to do the reverse mapping between Scaling and Scaling scale using Hibernate because and I have a @Embeddable class as Primary key, as below:
@Embeddable
public class EscalaDiaDetalhePK implements Serializable {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mycolmumn")
protected EscalaDetalhe escalaDia;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "idTurma")
protected Turma turma;
//getters , setters , hash and equals
}
I have the Definicaoescala class :
@Entity
@Table(name = "")
public class DefinicaoEscala {
@EmbeddedId
private EscalaDiaDetalhePKBean id;
@ManyToOne
private Turno turno;
}
and want to do the Onetomany reverse for the defining entity, I tried it as described below:
@Entity
@Table(name ="ESCALADETALHE")
public class EscalaDetalhe{
//properties
@OneToMany(fetch = FetchType.EAGER , mappedBy = "",orphanRemoval = true,cascade = CascadeType.ALL )
public List<DefinicaoEscala> definicoes;
}
What should I put on mappedBy?