Dozer을 내 의지에 맞게 구부리기 위해 고심하고 있습니다. 나는 두 모델을 매핑하고 싶습니다. 그러나 하나는 다른 모델보다 더 깊은 계층 구조를 가지고 있으며, 이는 컬렉션을 다룰 때 문제가됩니다.평범하지 않은 도저 매핑
소스 클래스 :
class Foo {
String id;
NameGroup nameGroup;
// Setters/Getters
}
class NameGroup {
private List<Name> names;
// Setters/Getters
}
class Name {
private String nameValue;
// Setters/Getters
}
대상 클래스 :
Foo.id -> Bar.barId // Simple enough
그러나 I :
class Bar {
private String barId;
private BarNames barNames;
// Setters/Getters
}
class BarNames {
private List<String> names;
// Setters/Getters
}
지금 나는 다음과 같은 단방향 매핑하고자 다음과 같은 클래스 고려 필요하다 :
Foo.nameGroup.names.nameValue -> Bar.barNames.names
각 Name
인스턴스가 Foo.nameGroup.names
일 경우 목록에 String
이 추가되어야합니다. 이것이 가능한가?
P.S. 이것은 힌트 없이도 작동합니다. – pjmyburg
고마워요. @pjmyburg - 이것에 대해 알려 드리겠습니다. – teabot