mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
EQL Named parameter support for Like and ieq
This commit is contained in:
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user