2

Dozer を使用してオブジェクト A を B にマッピングしています

Class A {
int indicatorA;
List<A> listA;
// get set methods...
}

Class B{
int indicatorB;
List<B> listB;
// get set methods...
}

A を B にマップしようとしていますが、親の indicatorA の値を listB 内のすべての子に設定したいと思います 例:

A parentA = new A();    // with indicatorA = 10
A child1A = new A();    // indicatorA value has not set
A child2A = new A();    // indicatorA value has not set
parentA.getListA.add(child1A);
parentA.getListA.add(child2A);

マッピング後、オブジェクト B をこのように表示したい

B parentB // indicatorB = 10 で、parentB.listB に 2 つのオブジェクト child1B と chld2B があり、indicatorB の値が 10 に設定されている

カスタムコンバーターを作成する方法、またはこれを行う簡単な方法は? どんな助けでも大歓迎です..ありがとう

4

1 に答える 1