Author: ruchaud Date: 2008-08-22 16:24:45 +0000 (Fri, 22 Aug 2008) New Revision: 1042 Modified: trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java Log: Gestion des arrays dans les requ?\195?\170tes HQL Modified: trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java =================================================================== --- trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java 2008-08-21 17:19:18 UTC (rev 1041) +++ trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java 2008-08-22 16:24:45 UTC (rev 1042) @@ -42,6 +42,7 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.Enumeration; @@ -813,7 +814,13 @@ try { Query query = getHibernate().createQuery(hql); for (int j = 0; j < args.length; j += 2) { - query.setParameter((String)args[j], args[j + 1]); + String name = (String)args[j]; + Object value = args[j + 1]; + if(value.getClass().isArray()) { + query.setParameterList(name, (Object[])value); + } else { + query.setParameter(name, value); + } } List result = query.list(); result = firesSupport.fireEntitiesLoad(this, result);
participants (1)
-
ruchaud@users.labs.libre-entreprise.org