Hibernate version:3.1
Hi, i have this sql query
Code:
Select * from sdgtwb_dat.PBODT$0F where aaarww=6 and
(mmarww in (4) and ggarww in (26,27,28,29,30))
or
(mmarww in (5) and ggarww in (2,3,4,5))
but i have with params value, how i can to do because hibernate understand the i wish to put one paramater for MMARWW and 3 or more parameter for GGARWW.
I hope that you can help me
Devis
Here hibernate don't work, throws java.sql.SQLException: Descriptor index not valid.
Code:
Criteria crit = session.createCriteria(CCommesseriVO.class, "vo")
.add(Restrictions.ne("STREPG", new String("A")))
.add(Restrictions.eq("FECMPG", new String("N")))
.createCriteria("consegne", "r")
.add(Restrictions.eq("r.SOARWW", new Integer(0)))
.add(Restrictions.eq("r.AAARWW", new Integer(year)))
.add(Restrictions.or(
Restrictions.sqlRestriction("({alias}.MMARWW IN (?) AND {alias}.GGARWW IN(?))"
params, types),
Restrictions.sqlRestriction("({alias}.MMARWW IN (?) AND {alias}.GGARWW IN(?))"
params2, types),
.setCacheable(true);