-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with HQL setParameterList()
PostPosted: Tue Nov 09, 2004 10:34 am 
Newbie

Joined: Tue Aug 24, 2004 12:01 pm
Posts: 4
Hi

I couldn't obtain any result from HQL, but I could do it with SQL

this the hbm.xml

<query name="reportSerialsByRemitos">
select st from Nstock st
where st.remito in (:pRemitos)
</query>

and the java code

public static Query getSerialsDataByRemitos(List remitos) throws Exception
{
Session hSession = HibernateSession.currentSession();

Query qSerials=hSession.getNamedQuery("reportSerialsByRemitos");
qSerials.setParameterList("pRemitos",remitos);


//HibernateSession.closeSession();
qSerials.setCacheable(true);
return qSerials;
}


and <property name="show_sql">true</property>

returns this sql statement :
select nstock0_.id_stock as id_stock, nstock0_.st_quantity as st_quant2_, nstock0_.st_serial as st_serial, nstock0_.st_elapsed_time as st_elaps4_, nstock0_.dt_created as dt_created, nstock0_.us_created as us_created, nstock0_.dt_modified as dt_modif7_, nstock0_.us_modified as us_modif8_, nstock0_.numero_pedido as numero_p9_, nstock0_.remito as remito, nstock0_.st_member as st_member, nstock0_.st_state as st_state, nstock0_.st_model as st_model from nstock nstock0_ where (nstock0_.remito in(?)) limit ?

But this query didn't return anything ! I was wondering why it's has a "limit ?" at the end ? and maybe that is the problem
Could you please help me ?
thnx you


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

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.