io.ebeaninternal.server.querydefn.OrmUpdateProperties Maven / Gradle / Ivy
package io.ebeaninternal.server.querydefn;
import io.ebean.core.type.ScalarType;
import io.ebeaninternal.server.deploy.DeployParser;
import io.ebeaninternal.server.persist.Binder;
import io.ebeaninternal.server.bind.DataBind;
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/**
* Set properties for a UpdateQuery.
*/
public final class OrmUpdateProperties {
private static final NullValue NULL_VALUE = new NullValue();
private static final NoneValue NONE_VALUE = new NoneValue();
/**
* Bind value used in the set clause for update query.
* It may/may not have bind values etc.
*/
public static abstract class Value {
public void bind(Binder binder, DataBind dataBind) throws SQLException {
// default to no bind values
}
public String bindClause() {
return "";
}
public int getBindCount() {
return 0;
}
}
/**
* Set property to null.
*/
private static final class NullValue extends Value {
@Override
public String bindClause() {
return "=null";
}
}
/**
* Set property to a simple value.
*/
private static final class SimpleValue extends Value {
final Object value;
final ScalarType
© 2015 - 2024 Weber Informatics LLC | Privacy Policy