Hello list,
I'm getting the following error:
SQLGrammarException: select this_.territorioCodigo as y0_,
this_.perfilId as y1_ from UsuarioTerritorioPerfilId this_ where
this_.usuarioId=?
when using the following query:
List utpList = session.createCriteria(UsuarioTerritorioPerfilId.class).setProjection(
Projections.projectionList()
.add(Projections.property("territorioCodigo"))
.add(Projections.property("perfilId"))
).add(Restrictions.eq("usuarioId",id)).list();
}catch (SQLGrammarException e) {
this.setMsg("Criteria error: No s'han pogut obtenir les dades: " +
e.getSQL());
return msg;
}
You can check the full code here:
http://dpaste.com/202714/ (mapped java
class) and here
http://dpaste.com/202716/ (function making the query).
Any tips will be appreciated :)
Regards,
Genis