I have the following relationship
IntheScaleDefinitionentity,Ihaveacompositeprimarykey
faultconsistingofidEscaleDetailsandidTurma
IamhavingdoubtstodothereversemappingbetweenScaleDetailsandScaleDefinitionusinghibernatesinceIhavean@Embeddableclassasaprimarykey,asbelow:
@EmbeddablepublicclassEscalaDiaDetalhePKimplementsSerializable{@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 class DefinitionScan:
@Entity
@Table(name = "")
public class DefinicaoEscala {
@EmbeddedId
private EscalaDiaDetalhePKBean id;
@ManyToOne
private Turno turno;
}
And I want to do the reverse OneToMany for the definition entity, I've 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 in the mappedBy ?