Package su.onno.ui

Class SqlBind

java.lang.Object
su.onno.ui.SqlBind

public final class SqlBind extends Object
Null-safe JDBI parameter binding shared by the generic catalog/document write paths and the framework-owned onno_comments writer.
  • Method Details

    • nullable

      public static void nullable(org.jdbi.v3.core.statement.SqlStatement<?> stmt, String column, Object value)
      Bind a value that may be null. A null is bound as an explicit unspecified-type SQL NULL (Types.OTHER) so PostgreSQL infers the target column type — e.g. uuid for a null _parent self-ref, any other null Ref<T>, or a null comment _author_id (an unlinked principal) — instead of defaulting the parameter to character varying and rejecting the implicit varchar → uuid cast. 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 (an Update/Query)
      column - the bound parameter name
      value - the already type-coerced value (UUID, BigDecimal, String, …) or null