-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Restrictions.sqlRestriction with or
PostPosted: Wed Mar 08, 2006 8:35 am 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
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);



Top
 Profile  
 
 Post subject: 我也有相同的问题(I same )
PostPosted: Mon May 21, 2007 9:56 pm 
Newbie

Joined: Mon Sep 18, 2006 9:41 pm
Posts: 1
在集合操作时,好像都没有成功过


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.