Package io.micronaut.data.r2dbc.mapper
Class R2dbcQueryStatement
java.lang.Object
io.micronaut.data.r2dbc.mapper.R2dbcQueryStatement
- All Implemented Interfaces:
QueryStatement<io.r2dbc.spi.Statement,
Integer>
public class R2dbcQueryStatement
extends Object
implements QueryStatement<io.r2dbc.spi.Statement,Integer>
Implementation of
QueryStatement
for R2DBC.- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorDescriptionR2dbcQueryStatement
(DataConversionService conversionService) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescription<T> T
convertRequired
(@Nullable Object value, Class<T> type) Convert the value to the given type.io.micronaut.core.convert.ConversionService
Get conversion service.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Sets an array value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> setBigDecimal
(io.r2dbc.spi.Statement statement, Integer name, BigDecimal bd) Write a BigDecimal value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> setBoolean
(io.r2dbc.spi.Statement statement, Integer name, boolean bool) Write a boolean value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a byte value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a byte[] value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a char value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a date value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a double value for the given name.QueryStatement<io.r2dbc.spi.Statement,
Integer> setDynamic
(@NonNull io.r2dbc.spi.Statement statement, @NonNull Integer index, @NonNull DataType dataType, Object value) Write a value dynamically using the result set and the given name and data type.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a float value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a int value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a long value for the given name.@NonNull QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a short value for the given name.QueryStatement<io.r2dbc.spi.Statement,
Integer> Write a string value for the given name.QueryStatement<io.r2dbc.spi.Statement,
Integer> Write an instant value for the given name.QueryStatement<io.r2dbc.spi.Statement,
Integer> setTimestamp
(io.r2dbc.spi.Statement statement, Integer name, Instant instant) Write an instant value for the given name.QueryStatement<io.r2dbc.spi.Statement,
Integer> Sets the give given object value.
-
Constructor Details
-
R2dbcQueryStatement
public R2dbcQueryStatement() -
R2dbcQueryStatement
Constructs a new instance.- Parameters:
conversionService
- The data conversion service- Since:
- 3.1
-
-
Method Details
-
getConversionService
public io.micronaut.core.convert.ConversionService getConversionService()Description copied from interface:QueryStatement
Get conversion service.- Specified by:
getConversionService
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Returns:
- the instance of
ConversionService
-
setDynamic
public QueryStatement<io.r2dbc.spi.Statement,Integer> setDynamic(@NonNull @NonNull io.r2dbc.spi.Statement statement, @NonNull @NonNull Integer index, @NonNull @NonNull DataType dataType, Object value) Description copied from interface:QueryStatement
Write a value dynamically using the result set and the given name and data type.- Specified by:
setDynamic
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementindex
- The indexdataType
- The data typevalue
- the value- Returns:
- The writer
-
setValue
public QueryStatement<io.r2dbc.spi.Statement,Integer> setValue(io.r2dbc.spi.Statement statement, Integer index, Object value) throws DataAccessException Description copied from interface:QueryStatement
Sets the give given object value.- Specified by:
setValue
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementindex
- The indexvalue
- The value- Returns:
- this writer
- Throws:
DataAccessException
- if the value cannot be read
-
convertRequired
Description copied from interface:QueryStatement
Convert the value to the given type.- Specified by:
convertRequired
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Type Parameters:
T
- The generic type- Parameters:
value
- The valuetype
- The type- Returns:
- The converted value
-
setLong
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setLong(io.r2dbc.spi.Statement statement, Integer name, long value) Description copied from interface:QueryStatement
Write a long value for the given name.- Specified by:
setLong
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)value
- The value- Returns:
- This writer
-
setChar
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setChar(io.r2dbc.spi.Statement statement, Integer name, char value) Description copied from interface:QueryStatement
Write a char value for the given name.- Specified by:
setChar
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)value
- The char value- Returns:
- This writer
-
setDate
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setDate(io.r2dbc.spi.Statement statement, Integer name, Date date) Description copied from interface:QueryStatement
Write a date value for the given name.- Specified by:
setDate
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)date
- The date- Returns:
- This writer
-
setTimestamp
public QueryStatement<io.r2dbc.spi.Statement,Integer> setTimestamp(io.r2dbc.spi.Statement statement, Integer name, Instant instant) Description copied from interface:QueryStatement
Write an instant value for the given name.- Specified by:
setTimestamp
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)instant
- The instant- Returns:
- This writer
-
setTime
public QueryStatement<io.r2dbc.spi.Statement,Integer> setTime(io.r2dbc.spi.Statement statement, Integer name, Time instant) Description copied from interface:QueryStatement
Write an instant value for the given name.- Specified by:
setTime
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)instant
- The time- Returns:
- This writer
-
setString
public QueryStatement<io.r2dbc.spi.Statement,Integer> setString(io.r2dbc.spi.Statement statement, Integer name, String string) Description copied from interface:QueryStatement
Write a string value for the given name.- Specified by:
setString
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)string
- The string- Returns:
- This writer
-
setInt
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setInt(io.r2dbc.spi.Statement statement, Integer name, int integer) Description copied from interface:QueryStatement
Write a int value for the given name.- Specified by:
setInt
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)integer
- The integer- Returns:
- This writer
-
setBoolean
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setBoolean(io.r2dbc.spi.Statement statement, Integer name, boolean bool) Description copied from interface:QueryStatement
Write a boolean value for the given name.- Specified by:
setBoolean
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)bool
- The boolean- Returns:
- This writer
-
setFloat
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setFloat(io.r2dbc.spi.Statement statement, Integer name, float f) Description copied from interface:QueryStatement
Write a float value for the given name.- Specified by:
setFloat
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)f
- The float- Returns:
- This writer
-
setByte
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setByte(io.r2dbc.spi.Statement statement, Integer name, byte b) Description copied from interface:QueryStatement
Write a byte value for the given name.- Specified by:
setByte
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)b
- The byte- Returns:
- This writer
-
setShort
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setShort(io.r2dbc.spi.Statement statement, Integer name, short s) Description copied from interface:QueryStatement
Write a short value for the given name.- Specified by:
setShort
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)s
- The short- Returns:
- This writer
-
setDouble
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setDouble(io.r2dbc.spi.Statement statement, Integer name, double d) Description copied from interface:QueryStatement
Write a double value for the given name.- Specified by:
setDouble
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)d
- The double- Returns:
- This writer
-
setBigDecimal
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setBigDecimal(io.r2dbc.spi.Statement statement, Integer name, BigDecimal bd) Description copied from interface:QueryStatement
Write a BigDecimal value for the given name.- Specified by:
setBigDecimal
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)bd
- The big decimal- Returns:
- This writer
-
setBytes
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setBytes(io.r2dbc.spi.Statement statement, Integer name, byte[] bytes) Description copied from interface:QueryStatement
Write a byte[] value for the given name.- Specified by:
setBytes
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)bytes
- the bytes- Returns:
- This writer
-
setArray
@NonNull public @NonNull QueryStatement<io.r2dbc.spi.Statement,Integer> setArray(io.r2dbc.spi.Statement statement, Integer name, Object array) Description copied from interface:QueryStatement
Sets an array value for the given name.- Specified by:
setArray
in interfaceQueryStatement<io.r2dbc.spi.Statement,
Integer> - Parameters:
statement
- The statementname
- The name (such as the column name)array
- the array- Returns:
- This writer
-