I got a class called Rappel and another called RappelPk (both generated by hibernate).
I try this:
findCriteria(Integer atrbFromRappelPk, String atrbFromRappel){
s = HibernateUtil.currentSession();
crit = s.createCriteria(getReferenceClass());
if(atrbFromRappelPk!=null){
crit.add(Expression.eq("codigoExterno", atrbFromRappelPk));
}
if(nombre != null && !nombre.equals("")){
crit.add(Expression.eq("numeroVendedor", atrbFromRappel));
}
retorno = crit.list();
}
With the attribute atrbFromRappel works well, but with the atrbFromRappelPk KO:
net.sf.hibernate.QueryException: could not resolve property: RappelPk.codigoExterno of: com.cofidis.fuentes.gestion.modelo.valueobject.Rappel
I tried the next:
crit.add(Expression.eq("RappelPk.codigoExterno", atrbFromRappelPk));
but it doesn't work, what can I do?
|