Orika - the mapper

java core 2016. 12. 2. 15:54

http://orika-mapper.github.io/orika-docs/



1. mapperFactory.classMap(Aclass, Bclass)

         .byDefault()  - 이름이 같은애들 자동 매핑

         .register()  - MapperFactory()에 등록.


        - 그 외 exclude()나 1Direction으로 map하는 방법도 존재.

        - 한쪽이 array라도 매핑가능. (index or first, last 이용) 

        - 한쪽이 classB의 List<A> 라도 가능  Bfield{ fieldOfA }

        - 한쪽이 Map<blabla,blabla2>라도 가능.  field{key}, field{value}

        - null 매핑 on/off도 가능.

        

- in line property:   user:{getName('user')|setBlaBla .. }  지원.

- 프로그래매틱하게 할 수 있도록, Property.Builder 지원.

- 상당히 복잡한 경우를 위해  (Introspector)PropertyResolver  존재.



2. mapperFactory.getMapperFacade()

    B = bMapper.map (A)


3. BoundMapperFacade< A, B>  bMapper = mapperFactory.getMapperFacade ( A,B)  :  성능이 좋음. 

   B = bMapper.map (A)






Posted by yongary
,