java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit 0f97ba4eb098c579dfb0488f5283451490d0b5d8 Author: Justin Sherrill jsherril@redhat.com Date: Tue Sep 29 11:53:47 2009 -0400
adding workaround for hibernate oddity/bug
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java index 1b40a33..a6092dc 100644 --- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java +++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java @@ -39,6 +39,7 @@ import org.hibernate.Session; import java.sql.Types; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -747,6 +748,10 @@ public class ServerFactory extends HibernateFactory { * @return list of system ids that are solaris systems */ public static List<Long> listSolarisSystems(Collection<Long> systemIds) { + //Hibernate can't handle empty lists for in clauses, silly hibernate + if (systemIds.isEmpty()) { + return Collections.EMPTY_LIST; + } return ServerFactory.getSession().getNamedQuery("Server.listSolarisSystems"). setParameterList("sids", systemIds).list(); } @@ -758,6 +763,10 @@ public class ServerFactory extends HibernateFactory { * @return list of system ids that are linux systems */ public static List<Long> listLinuxSystems(Collection<Long> systemIds) { + //Hibernate can't handle empty lists for in clauses, silly hibernate + if (systemIds.isEmpty()) { + return Collections.EMPTY_LIST; + } return ServerFactory.getSession().getNamedQuery("Server.listRedHatSystems"). setParameterList("sids", systemIds).list();
spacewalk-commits@lists.fedorahosted.org