Class DTOMapper<T,​S,​R>

    • Constructor Detail

      • DTOMapper

        public DTOMapper​(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​(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​(RuntimePersistentEntity<T> persistentEntity,
                         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
                                     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
                                     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 PersistentEntity getPersistentEntity()
        Returns:
        The entity in use
      • getResultReader

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