Good evening.
I have a bean, which has an init () method. One of the goals of this init is to bring the cycle that was opened according to the course of that user, ie If there is no cycle or evaluation process involved with the course of that logged in user, no simulation will be shown for it to respond. p>
The problem is that you're making a dent in my Query:
private List<Ciclo> ciclosCurso = new ArrayList<Ciclo>();
private void init(){
this.ciclosCurso = CicloDAO.buscaCicloPorCursoDoUsuario(codigoUsuario);
}
CICLODAO:
@SuppressWarnings("unchecked")
public List<Ciclo> buscaCicloPorCursoDoUsuario(Long codigo) {
return manager
.createQuery("select c from Ciclo c JOIN curso_ciclo a WHERE CODIGO_CURSO = ?1")
.setParameter(1, codigo).getResultList();
}
This table course_cycle is a relationship between Course and Cycle from many to many, ie @ManyToMany
It gives an error in Query,
ERROR: Path expected for join! Oct 31, 2015 12:17:29 AM org.hibernate.hql.internal.ast.ErrorCounter reportError ERROR: Path expected for join!