mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
* no effective code change: add missing @override in "io.ebean.*" package * no effective code change: add missing @override in "io.ebeaninternal.api.*" package * no effective code change: add missing @override in "io.ebeaninternal.server.*" package * no effective code change: add missing @override in "io.ebeaninternal.util.*" package * no effective code change: add missing @override in "io.ebeanservice.*" package * no effective code change: add missing @override in "src/test/java/"
47 lines
939 B
Java
47 lines
939 B
Java
package io.ebeaninternal.server.querydefn;
|
|
|
|
import io.ebeaninternal.api.SpiNamedParam;
|
|
|
|
import javax.persistence.PersistenceException;
|
|
|
|
/**
|
|
* Named parameter used as placeholder in expressions created by EQL language parsing.
|
|
*/
|
|
class ONamedParam implements SpiNamedParam {
|
|
|
|
private final String name;
|
|
|
|
private Object value;
|
|
|
|
/**
|
|
* Create with the given name.
|
|
*/
|
|
ONamedParam(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
/**
|
|
* Set the bind value for this named parameter.
|
|
*/
|
|
public void setValue(Object value) {
|
|
this.value = value;
|
|
}
|
|
|
|
/**
|
|
* Return the bind value for this named parameter.
|
|
*/
|
|
@Override
|
|
public Object getValue() {
|
|
return value;
|
|
}
|
|
|
|
/**
|
|
* Check the bind value has been set (so does not support null value).
|
|
*/
|
|
void checkValueSet() {
|
|
if (value == null) {
|
|
throw new PersistenceException("Named parameter [" + name + "] has not had it's value set.");
|
|
}
|
|
}
|
|
}
|