Class SqlJsonColumnMapperProvider<S>
java.lang.Object
io.micronaut.data.runtime.operations.internal.sql.SqlJsonColumnMapperProvider<S>
- Type Parameters:
 S- the reader result set type
The provider for 
SqlJsonValueMapper when JSON columns are being written using SqlStoredQuery
 and for SqlJsonColumnReader when JSON columns are being read from SqlPreparedQuery results.- Since:
 - 4.0.0
 - Author:
 - radovanradic
 
- 
Constructor Summary
ConstructorsConstructorDescriptionSqlJsonColumnMapperProvider(@Nullable io.micronaut.json.JsonMapper jsonMapper, List<SqlJsonColumnReader<S>> sqlJsonColumnReaders, List<SqlJsonValueMapper> sqlJsonValueMappers) Default constructor. - 
Method Summary
Modifier and TypeMethodDescriptiongetJsonColumnReader(SqlStoredQuery<?, ?> sqlStoredQuery, Class<S> resultSetType) ProvidesSqlJsonColumnReaderfor given SQL prepared query.getJsonValueMapper(SqlStoredQuery<?, ?> sqlStoredQuery, JsonDataType jsonDataType, Object value) ProvidesSqlJsonValueMapperfor given SQL stored query. 
- 
Constructor Details
- 
SqlJsonColumnMapperProvider
public SqlJsonColumnMapperProvider(@Nullable @Nullable io.micronaut.json.JsonMapper jsonMapper, List<SqlJsonColumnReader<S>> sqlJsonColumnReaders, List<SqlJsonValueMapper> sqlJsonValueMappers) Default constructor.- Parameters:
 jsonMapper- the default JSON mappersqlJsonColumnReaders- list of custom SQL JSON column readerssqlJsonValueMappers- list of custom SQL JSON value mappers
 
 - 
 - 
Method Details
- 
getJsonColumnReader
public SqlJsonColumnReader<S> getJsonColumnReader(SqlStoredQuery<?, ?> sqlStoredQuery, Class<S> resultSetType) ProvidesSqlJsonColumnReaderfor given SQL prepared query. If there is specificSqlJsonColumnReaderthat supports given prepared query and result set type then it will be returned. Otherwise, it will return defaultSqlJsonColumnReader.- Parameters:
 sqlStoredQuery- the SQL stored queryresultSetType- the result set type (for R2Dbc and Jdbc it is different for example)- Returns:
 - the 
SqlJsonColumnReaderfor given SQL prepared query, or defaultSqlJsonColumnReaderif prepared query does not have specific one that it supports 
 - 
getJsonValueMapper
public SqlJsonValueMapper getJsonValueMapper(SqlStoredQuery<?, ?> sqlStoredQuery, JsonDataType jsonDataType, Object value) ProvidesSqlJsonValueMapperfor given SQL stored query. If there is specificSqlJsonValueMapperthat supports given stored query then it will be returned. Otherwise, it will return defaultSqlJsonValueMapper.- Parameters:
 sqlStoredQuery- the SQL stored queryjsonDataType- the JSON representation typevalue- the value to be mapped- Returns:
 - the 
SqlJsonValueMapperfor given SQL stored query, or defaultSqlJsonValueMapperif stored query does not have specific one that it supports 
 
 -