Hi, I have a relationship manytoone like this:
Periodo---manytoone->dia----manytoone--->horario
when I save periodo, dia and horario do not save, and it does not throw and exception, it just doesn´t save. this is my code:
In periodo class:
@OneToMany(fetch = FetchType.LAZY, mappedBy = "periodo", cascade=CascadeType.ALL) @OrderBy("dia ASC") public Set<Dia> getDias() { return this.dias; }
In Dia clasS:
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "periodo", nullable = false) @NotNull public Periodo getPeriodo() { return this.periodo; }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "dia") @OrderBy("inicio ASC") public Set<Horario> getHorarios() { return this.horarios; }
in horario class:
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "dia", nullable = false, insertable=true, updatable=true) @NotNull public Dia getDia() { return this.dia; }
Any ideas??
|