Package io.micronaut.data.runtime.mapper
Class DTOMapper<T,S,R>  
java.lang.Object
io.micronaut.data.runtime.mapper.DTOMapper<T,S,R>  
- Type Parameters:
- T- The entity type
- S- The source type.
- R- The result type
- All Implemented Interfaces:
- BeanIntrospectionMapper<S,,- R> - TypeMapper<S,- R> 
- Direct Known Subclasses:
- SqlDTOMapper
A 
BeanIntrospectionMapper that reads the result using the specified
 PersistentEntity and ResultReader and using the BeanIntrospectionMapper.map(Object, Class) allows mapping a result to a introspected Data Transfer Object (DTO).- 
Constructor SummaryConstructorsConstructorDescriptionDTOMapper(RuntimePersistentEntity<T> persistentEntity, RuntimePersistentEntity<?> dtoEntity, ResultReader<S, String> resultReader, @Nullable JsonColumnReader<S> jsonColumnReader, DataConversionService conversionService) Default constructor.DTOMapper(RuntimePersistentEntity<T> persistentEntity, ResultReader<S, String> resultReader, @Nullable JsonColumnReader<S> jsonColumnReader, DataConversionService conversionService) Default constructor.DTOMapper(RuntimePersistentEntity<T> persistentEntity, ResultReader<S, String> resultReader, DataConversionService conversionService) Default constructor.
- 
Method SummaryModifier and TypeMethodDescription@Nullable ObjectRead a value for the given name from the given object.@Nullable Objectread(S resultSet, @NonNull RuntimePersistentProperty<?> property) Read the given property.@Nullable ObjectRead a value for the given name from the given object.@Nullable ObjectRead the value from the given result set for the given persisted name and data type.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.runtime.mapper.BeanIntrospectionMapperconvert, map
- 
Constructor Details- 
DTOMapperpublic DTOMapper(RuntimePersistentEntity<T> persistentEntity, ResultReader<S, String> resultReader, DataConversionService conversionService) Default constructor.- Parameters:
- persistentEntity- The entity
- resultReader- The result reader
- conversionService-
 
- 
DTOMapperpublic DTOMapper(RuntimePersistentEntity<T> persistentEntity, ResultReader<S, String> resultReader, @Nullable @Nullable JsonColumnReader<S> jsonColumnReader, DataConversionService conversionService) Default constructor.- Parameters:
- persistentEntity- The entity
- resultReader- The result reader
- jsonColumnReader- The JSON column reader
- conversionService-
 
- 
DTOMapperpublic DTOMapper(RuntimePersistentEntity<T> persistentEntity, RuntimePersistentEntity<?> dtoEntity, ResultReader<S, String> resultReader, @Nullable @Nullable JsonColumnReader<S> jsonColumnReader, DataConversionService conversionService) Default constructor.- Parameters:
- persistentEntity- The entity
- dtoEntity- The dto entity
- resultReader- The result reader
- jsonColumnReader- The JSON column reader
- conversionService-
 
 
- 
- 
Method Details- 
getConversionService- Specified by:
- getConversionServicein interface- TypeMapper<T,- S> 
- Returns:
- The conversion service to use.
 
- 
read@Nullable public @Nullable Object read(@NonNull S object, @NonNull @NonNull String name) throws io.micronaut.core.convert.exceptions.ConversionErrorException Description copied from interface:TypeMapperRead a value for the given name from the given object.- Specified by:
- readin interface- TypeMapper<T,- S> 
- Parameters:
- object- The object to read from
- name- The name
- Returns:
- The value
- Throws:
- io.micronaut.core.convert.exceptions.ConversionErrorException
 
- 
read@Nullable public @Nullable Object read(@NonNull S object, @NonNull @NonNull io.micronaut.core.type.Argument<?> argument) Description copied from interface:TypeMapperRead a value for the given name from the given object.- Specified by:
- readin interface- TypeMapper<T,- S> 
- Parameters:
- object- The object to read from
- argument- The argument
- Returns:
- The value
 
- 
read@Nullable public @Nullable Object read(@NonNull S resultSet, @NonNull @NonNull RuntimePersistentProperty<?> property) Read the given property.- Parameters:
- resultSet- The result set
- property- THe property
- Returns:
- The result
 
- 
read@Nullable public @Nullable Object read(@NonNull S resultSet, @NonNull @NonNull String persistedName, @NonNull @NonNull DataType dataType) Read the value from the given result set for the given persisted name and data type.- Parameters:
- resultSet- The result set
- persistedName- The persisted name
- dataType- The data type
- Returns:
- The result
 
- 
getPersistentEntity- Returns:
- The entity in use
 
- 
getResultReader- Returns:
- the result reader
 
 
-