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
|