主页
http://orika-mapper.github.io/orika-docs/mappings-via-classmapbuilder.html
执行完mapperFactory.classMap()...register后,日志将打印出classMap中每个字段的对应关系
23:11:48.123 [main] DEBUG ma.glasnost.orika.metadata.ClassMapBuilder - ClassMap created:
ClassMapBuilder.map(BookEntity, BookDTO)
.field( authorName(String), author.name(String) )
.field( authorBirthday(LocalDate), author.birthday(LocalDate) )
.field( type(Integer), bookType(BookType) )
.field( bookInformation(String), bookInfo(BookInfo) )
.field( bookId(Integer), bookId(String) )
.field( bookName(String), bookName(String) )
.field( nullValue(String), nullValue(String) )
执行完mapperFactory.getMapperFacade();日志将打印出创建的代理映射类和每个字段的映射关系,字段拷贝方式,使用的转换器等等
23:15:12.666 [main] DEBUG ma.glasnost.orika.impl.generator.MapperGenerator - Generating new mapper for (BookEntity, BookDTO)
Orika_BookDTO_BookEntity_Mapper2400467731166$0.mapAToB(BookEntity, BookDTO) {
Field(authorName(String), author.name(String)) : copying String by reference
Field(authorBirthday(LocalDate), author.birthday(LocalDate)) : copying LocalDate by reference
Field(type(Integer), bookType(BookType)) : converting using BidirectionalConverter<BookType, Integer>
Field(bookInformation(String), bookInfo(BookInfo)) : converting using BidirectionalConverter(JsonConfigConvert)<Object, String>
Field(bookId(Integer), bookId(String)) : converting using builtin:ToStringConverter<Object, Object>
Field(bookName(String), bookName(String)) : copying String by reference
Field(nullValue(String), nullValue(String)) : copying String by reference
}
Orika_BookDTO_BookEntity_Mapper2400467731166$0.mapBToA(BookDTO, BookEntity) {
Field(author.name(String), authorName(String)) : copying String by reference
Field(author.birthday(LocalDate), authorBirthday(LocalDate)) : copying LocalDate by reference
Field(bookType(BookType), type(Integer)) : converting using BidirectionalConverter<BookType, Integer>
Field(bookInfo(BookInfo), bookInformation(String)) : converting using BidirectionalConverter(JsonConfigConvert)<Object, String>
Field(bookId(String), bookId(Integer)) : converting using builtin:FromStringConverter<Object, Object>
Field(bookName(String), bookName(String)) : copying String by reference
Field(nullValue(String), nullValue(String)) : copying String by reference
}
Types used: [BookType, BookInfo, String, Integer]
Converters used: [BidirectionalConverter<BookType, Integer>, BidirectionalConverter(JsonConfigConvert)<Object, String>, builtin:ToStringConverter<Object, Object>, builtin:FromStringConverter<Object, Object>]
BoundMapperFacades used: [DefaultBoundMapperFacade<String, AuthorDTO>, DefaultBoundMapperFacade<LocalDate, AuthorDTO>]
网友评论