Class GeneratedJdbcData
java.lang.Object
io.helidon.data.jdbc.GeneratedJdbcData
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 Summary
Modifier and TypeMethodDescriptionstatic JdbcClient.StatementbindNull(JdbcClient.Statement statement, int index, JDBCType type) Binds SQLNULLfor a generated declarative repository.static JdbcClient.StatementcreateGenerated(JdbcClient client, String sql, int parameterCount) Creates a statement description for generated repository code that has already validated the positional JDBC SQL.
-
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 clientsql- validated SQL containing positional JDBC markersparameterCount- exact number of physical JDBC markers- Returns:
- statement description
- Throws:
NullPointerException- if the client or SQL isnullIllegalArgumentException- 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 SQLNULLfor 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 providerindex- JDBC position starting at onetype- SQL type of the null value- Returns:
- the statement
- Throws:
NullPointerException- if the statement or type isnullIllegalArgumentException- if the position or type is invalid or the type requires a database type nameIllegalStateException- if a terminal operation has startedUnsupportedOperationException- if the statement was not created by Helidon's JDBC provider
-