Package su.onno.ui
Class SqlBind
java.lang.Object
su.onno.ui.SqlBind
Null-safe JDBI parameter binding shared by the generic catalog/document write paths and the
framework-owned
onno_comments writer.-
Method Summary
-
Method Details
-
nullable
public static void nullable(org.jdbi.v3.core.statement.SqlStatement<?> stmt, String column, Object value) Bind a value that may benull. A null is bound as an explicit unspecified-type SQL NULL (Types.OTHER) so PostgreSQL infers the target column type — e.g.uuidfor a null_parentself-ref, any other nullRef<T>, or a null comment_author_id(an unlinked principal) — instead of defaulting the parameter tocharacter varyingand rejecting the implicitvarchar → uuidcast. JDBI binds an untyped null as varchar, which H2 silently coerces but PostgreSQL refuses, so every top-level catalog/document insert (null_parent) and every comment from an unlinked author would otherwise fail on Postgres. (#163, #171)- Parameters:
stmt- the statement to bind on (anUpdate/Query)column- the bound parameter namevalue- the already type-coerced value (UUID, BigDecimal, String, …) ornull
-