EQL Named parameter support for Like and ieq

This commit is contained in:
Robin Bygrave committed 2016-07-12 21:56:43 +12:00
1 parent 1a1c432c2a
commit 84b37fb014
10 files changed
+123 -88

No files matched your search

@@ -0,0 +1,28 @@
package com.avaje.ebeaninternal.server.expression;
import com.avaje.ebeaninternal.api.SpiNamedParam;
/**
* Helper for evaluating named parameters.
*/
class NamedParamHelp {
/**
* Return the bind value taking into account named parameters.
*/
static Object value(Object val) {
if (val instanceof SpiNamedParam) {
return ((SpiNamedParam) val).getValue();
}
return val;
}
/**
* Return the value as a string.
*/
static String valueAsString(Object val) {
Object value = value(val);
return (value == null) ? null : value.toString();
}
}