mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1205 - ENH: Add support for raw expression array binding with Postgres - e.g. raw(" foo = any(?) ", collection)
This commit is contained in:
@@ -5,8 +5,10 @@ import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.persist.MultiValueWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
class RawExpression extends NonPrepareExpression {
|
||||
|
||||
@@ -43,7 +45,12 @@ class RawExpression extends NonPrepareExpression {
|
||||
public void addBindValues(SpiExpressionRequest request) {
|
||||
if (values != null) {
|
||||
for (Object value : values) {
|
||||
request.addBindValue(value);
|
||||
if (value instanceof Collection<?>) {
|
||||
// support for Postgres = any(?) type raw expression
|
||||
request.addBindValue(new MultiValueWrapper((Collection<?>)value));
|
||||
} else {
|
||||
request.addBindValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user