#2619 - Lack of setNullParameter() functionality on io.ebean.SqlQuery interface

This commit is contained in:
Rob Bygrave committed 2022-03-29 22:41:36 +13:00
1 parent aa89df5f00
commit 4cad515110
4 files changed
+73 -2

No files matched your search

@@ -167,7 +167,7 @@ public final class BindParams implements Serializable {
*/
@SuppressWarnings("rawtypes")
public void setParameter(int position, Object value) {
assert value != null : "use setNullParameter";
//TODO: Review - assert value != null : "use setNullParameter";
Param p = getParam(position);
if (value instanceof Collection) {
// use of postgres ANY with positioned parameter
@@ -219,7 +219,7 @@ public final class BindParams implements Serializable {
* Set a named In parameter that is not null.
*/
public Param setParameter(String name, Object value) {
assert value != null : "use setNullParameter";
// TODO: Review - assert value != null : "use setNullParameter";
Param p = getParam(name);
p.setInValue(value);
return p;
@@ -119,6 +119,18 @@ public final class DefaultRelationalQuery extends AbstractQuery implements SpiSq
return this;
}
@Override
public SqlQuery setNullParameter(int position, int jdbcType) {
bindParams.setNullParameter(position, jdbcType);
return this;
}
@Override
public SqlQuery setNullParameter(String name, int jdbcType) {
bindParams.setNullParameter(name, jdbcType);
return this;
}
@Override
public DefaultRelationalQuery setParameter(int position, Object value) {
bindParams.setParameter(position, value);