0
It is possible to mount a list in a class with only a few objects?
@NamedQuery(name = "Curso.Aprovados", query = "select cur from Classificacao cl JOIN cl.candidato ca JOIN ca.curso cur")
public class Curso {
@Id
@Column(name = "id")
private int id;
@OneToMany(fetch = FetchType.LAZY)
private List<Candidato> candidatoList;
...
}
public class Candidato {
@Id
@Column(name = "id")
private Integer idCa;
@JoinColumn(name = "id_curso", referencedColumnName = "id")
@ManyToOne(optional = false, cascade = CascadeType.DETACH)
private Curso curso;
...
}
public class Classificacao {
@Id
@Column(name = "id")
private int id;
@OneToOne
@JoinColumn(name = "id_candidato", referencedColumnName = "id")
private Candidato candidato;
...
}
I would like the candidate list in the course class, only contain candidates who have a rating, in this case this Select includes what I need, just do not know how to load these candidates on the course list.
select cur from Classificacao cl JOIN cl.candidato ca JOIN ca.curso cur
Thank you very much
First, thank you so much for your help.
– Lauro Correa Junior