Class DTOMapper<T,​S,​R>

    • Constructor Summary

      Constructors 
      Constructor Description
      DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, io.micronaut.data.model.runtime.RuntimePersistentEntity<?> dtoEntity, ResultReader<S,​java.lang.String> resultReader, io.micronaut.http.codec.MediaTypeCodec jsonCodec, DataConversionService<?> conversionService)
      Default constructor.
      DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, ResultReader<S,​java.lang.String> resultReader, DataConversionService<?> conversionService)
      Default constructor.
      DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, ResultReader<S,​java.lang.String> resultReader, io.micronaut.http.codec.MediaTypeCodec jsonCodec, DataConversionService<?> conversionService)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DataConversionService<?> getConversionService()  
      io.micronaut.data.model.PersistentEntity getPersistentEntity()  
      ResultReader<S,​java.lang.String> getResultReader()  
      java.lang.Object read​(S object, io.micronaut.core.type.Argument<?> argument)
      Read a value for the given name from the given object.
      java.lang.Object read​(S resultSet, io.micronaut.data.model.runtime.RuntimePersistentProperty<?> property)
      Read the given property.
      java.lang.Object read​(S object, java.lang.String name)
      Read a value for the given name from the given object.
      java.lang.Object read​(S resultSet, java.lang.String persistedName, io.micronaut.data.model.DataType dataType)
      Read the value from the given result set for the given persisted name and data type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DTOMapper

        public DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity,
                         ResultReader<S,​java.lang.String> resultReader,
                         DataConversionService<?> conversionService)
        Default constructor.
        Parameters:
        persistentEntity - The entity
        resultReader - The result reader
        conversionService -
      • DTOMapper

        public DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity,
                         ResultReader<S,​java.lang.String> resultReader,
                         @Nullable
                         io.micronaut.http.codec.MediaTypeCodec jsonCodec,
                         DataConversionService<?> conversionService)
        Default constructor.
        Parameters:
        persistentEntity - The entity
        resultReader - The result reader
        jsonCodec - The JSON codec
        conversionService -
      • DTOMapper

        public DTOMapper​(io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity,
                         io.micronaut.data.model.runtime.RuntimePersistentEntity<?> dtoEntity,
                         ResultReader<S,​java.lang.String> resultReader,
                         @Nullable
                         io.micronaut.http.codec.MediaTypeCodec jsonCodec,
                         DataConversionService<?> conversionService)
        Default constructor.
        Parameters:
        persistentEntity - The entity
        dtoEntity - The dto entity
        resultReader - The result reader
        jsonCodec - The JSON codec
        conversionService -
    • Method Detail

      • read

        @Nullable
        public java.lang.Object read​(@NonNull
                                     S object,
                                     @NonNull
                                     java.lang.String name)
                              throws io.micronaut.core.convert.exceptions.ConversionErrorException
        Description copied from interface: TypeMapper
        Read a value for the given name from the given object.
        Specified by:
        read in 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 java.lang.Object read​(@NonNull
                                     S object,
                                     @NonNull
                                     io.micronaut.core.type.Argument<?> argument)
        Description copied from interface: TypeMapper
        Read a value for the given name from the given object.
        Specified by:
        read in interface TypeMapper<T,​S>
        Parameters:
        object - The object to read from
        argument - The argument
        Returns:
        The value
      • read

        @Nullable
        public java.lang.Object read​(@NonNull
                                     S resultSet,
                                     @NonNull
                                     io.micronaut.data.model.runtime.RuntimePersistentProperty<?> property)
        Read the given property.
        Parameters:
        resultSet - The result set
        property - THe property
        Returns:
        The result
      • read

        @Nullable
        public java.lang.Object read​(@NonNull
                                     S resultSet,
                                     @NonNull
                                     java.lang.String persistedName,
                                     @NonNull
                                     io.micronaut.data.model.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

        public io.micronaut.data.model.PersistentEntity getPersistentEntity()
        Returns:
        The entity in use
      • getResultReader

        public ResultReader<S,​java.lang.String> getResultReader()
        Returns:
        the result reader