#919 - io.ebean package initial

This commit is contained in:
Rob Bygrave
2016-12-11 23:23:22 +13:00
parent 5821dc96b9
commit 971e2dc91b
2134 changed files with 10721 additions and 8652 deletions
@@ -0,0 +1,45 @@
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.
*/
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.");
}
}
}