[seam-commits] Seam SVN: r8586 - trunk/src/main/org/jboss/seam/persistence.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Aug 5 14:08:03 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-08-05 14:08:03 -0400 (Tue, 05 Aug 2008)
New Revision: 8586
Modified:
trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java
Log:
JBSEAM-3097, thanks to Craig Savolainen
Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-08-05 17:59:05 UTC (rev 8585)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-08-05 18:08:03 UTC (rev 8586)
@@ -4,6 +4,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.Collection;
import java.util.Map;
import javax.persistence.EntityManager;
@@ -212,7 +213,12 @@
org.hibernate.Filter filter = getSession(entityManager).enableFilter( f.getName() );
for ( Map.Entry<String, ValueExpression> me: f.getParameters().entrySet() )
{
- filter.setParameter( me.getKey(), me.getValue().getValue() );
+ Object filterValue = me.getValue().getValue();
+ if ( filterValue instanceof Collection ) {
+ filter.setParameterList(me.getKey(), (Collection) filterValue);
+ } else {
+ filter.setParameter(me.getKey(), filterValue);
+ }
}
filter.validate();
}
Modified: trunk/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java 2008-08-05 17:59:05 UTC (rev 8585)
+++ trunk/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java 2008-08-05 18:08:03 UTC (rev 8586)
@@ -3,6 +3,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -101,7 +102,12 @@
org.hibernate.Filter filter = session.enableFilter( f.getName() );
for ( Map.Entry<String, ValueExpression> me: f.getParameters().entrySet() )
{
- filter.setParameter( me.getKey(), me.getValue().getValue() );
+ Object filterValue = me.getValue().getValue();
+ if ( filterValue instanceof Collection ) {
+ filter.setParameterList(me.getKey(), (Collection) filterValue);
+ } else {
+ filter.setParameter(me.getKey(), filterValue);
+ }
}
filter.validate();
}
More information about the seam-commits
mailing list