Class JsonQueryResultMapper<T,RS,R>
java.lang.Object
io.micronaut.data.runtime.mapper.sql.JsonQueryResultMapper<T,RS,R>
- Type Parameters:
T
- The entity typeRS
- The result set typeR
- The result type
- All Implemented Interfaces:
SqlTypeMapper<RS,
,R> TypeMapper<RS,
R>
The JSON query result mapper. Transforms result from single column with JSON value into the given entity.
- Since:
- 4.0.0.
- Author:
- radovanradic
-
Constructor Summary
ConstructorDescriptionJsonQueryResultMapper
(@NonNull String columnName, @NonNull JsonDataType jsonDataType, @NonNull RuntimePersistentEntity<T> entity, @NonNull ResultReader<RS, String> resultReader, @NonNull SqlJsonColumnReader<RS> sqlJsonColumnReader, @Nullable BiFunction<RuntimePersistentEntity<Object>, Object, Object> eventListener) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.runtime.mapper.TypeMapper
getConversionService, read
-
Constructor Details
-
JsonQueryResultMapper
public JsonQueryResultMapper(@NonNull @NonNull String columnName, @NonNull @NonNull JsonDataType jsonDataType, @NonNull @NonNull RuntimePersistentEntity<T> entity, @NonNull @NonNull ResultReader<RS, String> resultReader, @NonNull @NonNull SqlJsonColumnReader<RS> sqlJsonColumnReader, @Nullable @Nullable BiFunction<RuntimePersistentEntity<Object>, Object, Object> eventListener)
-
-
Method Details
-
map
Description copied from interface:TypeMapper
Map the given result set to the given object.- Specified by:
map
in interfaceTypeMapper<T,
RS> - Parameters:
rs
- The object to maptype
- The type- Returns:
- The mapped object
- Throws:
DataAccessException
- If the object cannot be mapped.
-
read
Description copied from interface:TypeMapper
Read a value for the given name from the given object.- Specified by:
read
in interfaceTypeMapper<T,
RS> - Parameters:
object
- The object to read fromname
- The name- Returns:
- The value
-
hasNext
Description copied from interface:SqlTypeMapper
Is another result available.- Specified by:
hasNext
in interfaceSqlTypeMapper<T,
RS> - Parameters:
resultSet
- The result set- Returns:
- True if it is
-