¿pasar la lista a la cláusula IN en HQL o SQL?
Obtengo List<Strings>
ejecutando una consulta. Esto se debe pasar a otra consulta de EN los valores de la cláusula. ¿Cómo pasarlos en HQL ?
Podemos convertir List
a Array
y podemos pasarlo, eso no es un problema.
Finalmente, debo pasar la lista en forma List<String>
o Array
o String
a la cláusula IN.
35
Author: Luiggi Mendoza, 2012-09-29
2 answers
from AUTOS a where a.model in (select m.model from MODELS m)
O
Query query1 = session.createQuery("select s.id from Salary s where s.salary < 50000 AND s.salary > 49980");
Query query2 = session.createQuery("from Employee e where e.id in (:ids)").setParameterList("ids", query1.list());
query2.list();
72
Author: Sergii Shevchyk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-01 06:49:41
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-01 06:49:41
Sé que ha pasado un tiempo y que ha estado tratando de pasar el valor de una consulta diferente como un queryParameter, también puede pasar set o collections a in clause en HQL con ' elements () ' - aquí hay un simple ejemplo de este uso: Consulta de hibernación: ¿un Conjunto contiene un Objeto determinado?
3
Author: Sinan Kucukkoseler,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:26:24
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:26:24