Class GeneratedJdbcData

java.lang.Object
io.helidon.data.jdbc.GeneratedJdbcData

public final class GeneratedJdbcData extends Object
Methods used by generated Helidon Data JDBC repositories.

These methods form the compatibility boundary between JDBC repository code generation and the JDBC runtime. Application code uses JdbcClient directly.

  • Method Details

    • createGenerated

      public static JdbcClient.Statement createGenerated(JdbcClient client, String sql, int parameterCount)
      Creates a statement description for generated repository code that has already validated the positional JDBC SQL.

      The physical marker count is computed by the annotation processor. A statement from Helidon's JDBC provider avoids scanning static SQL and accessing the runtime marker count cache. An alternate provider uses its supported JdbcClient.create(String) operation.

      Parameters:
      client - JDBC client
      sql - validated SQL containing positional JDBC markers
      parameterCount - exact number of physical JDBC markers
      Returns:
      statement description
      Throws:
      NullPointerException - if the client or SQL is null
      IllegalArgumentException - if the parameter count is negative or greater than the SQL text length
    • bindNull

      public static JdbcClient.Statement bindNull(JdbcClient.Statement statement, int index, JDBCType type)
      Binds SQL NULL for a generated declarative repository.

      This method accepts only a statement created by Helidon's JDBC provider. Types that require a database type name are not supported.

      Parameters:
      statement - statement created by Helidon's JDBC provider
      index - JDBC position starting at one
      type - SQL type of the null value
      Returns:
      the statement
      Throws:
      NullPointerException - if the statement or type is null
      IllegalArgumentException - if the position or type is invalid or the type requires a database type name
      IllegalStateException - if a terminal operation has started
      UnsupportedOperationException - if the statement was not created by Helidon's JDBC provider