Hi friends!
How I can put double class in Criteria?
Well, my hql is:
Code:
String sql = " from br.com.ag2.quatromais.vo.Compromisso as c where " +" c.dthInicioCompromisso >= " + dtInitial
+ " and c.dthFimCompromisso <= " + dtFinal
+" and c.agenda.campanha.codCampanha = " + cod_campanha
+" order by c.dthInicioCompromisso asc";
I try make this:
Code:
Criteria criteria = session.createCriteria(Compromisso.class);
Date dtInitial = compromisso.getDthInicioCompromisso();
Date dtFinal = compromisso.getDthFimCompromisso();
criteria.add( Expression.ge("dthInicioCompromisso",dtInitial));
criteria.add( Expression.le("dthFimCompromisso",dtFinal));
criteria.add( Expression.eq("agenda.campanha.codCampanha",cod_campanha));
criteria.addOrder(Order.asc("dthInicioCompromisso"));
But in line
Code:
criteria.add( Expression.eq("agenda.campanha.codCampanha",cod_campanha));
Hibernate acuse an error:
Quote:
2004-07-28 09:12:01,140 ERROR opensymphony.xwork.ActionSupport -> Error in findCompromisso: net.sf.hibernate.QueryException: could not resolve property: agenda.campanha.codCampanha of: br.com.ag2.quatromais.vo.Compromisso
But this property exists!
My HQL work correctly.
Well, any help is welcome!
Thanks friends!
Regards