mirror of https://github.com/apache/openjpa.git
Convert single values into Collections in order to support varargs "IN" expressions.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@487925 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d98ca1d91d
commit
25988d2793
|
@ -16,6 +16,7 @@
|
|||
package org.apache.openjpa.kernel.exps;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.openjpa.kernel.StoreContext;
|
||||
|
||||
|
@ -68,7 +69,8 @@ class ContainsExpression
|
|||
* Return the container collection for the given value.
|
||||
*/
|
||||
protected Collection getCollection(Object obj) {
|
||||
return (Collection) obj;
|
||||
return obj instanceof Collection ?
|
||||
(Collection) obj : Collections.singleton(obj);
|
||||
}
|
||||
|
||||
public void acceptVisit(ExpressionVisitor visitor) {
|
||||
|
|
Loading…
Reference in New Issue