B-Bill
B-Bill

Reputation: 43

Orika Mapping configuration for mapping nested properties to another object using default mapping

I want to do a particular mapping and I don't know if it's possible and if yes, how to configure Orika to do the mapping. Let's say I have those classes

public class ClassA {
    private ClassB bInstance;
}

public class ClassB {
    private String varA;
    private String varB;
    private String varC;
    ...
    private String varZ;
}

public class ClassZ {
    private String varA;
    private String varB;
    private String varC;
    ...
    private String varZ;
}

I want to map ClassA with ClassZ, so I want to map nested properties of bInstance in ClassA instance to a ClassZ instance using the default mapping (since the names are the same).

Any help would be greatly appreciated.

Regards

Upvotes: 2

Views: 1230

Answers (1)

Sidi
Sidi

Reputation: 1739

No, it could be done for ClassB and ClassZ not for ClassA and ClassZ

Maybe if Orika support a (virtual) property 'this', it can be done easily. (by mapping ClassA.bInstance to ClassZ.this)

This can be a good feature request :)

Upvotes: 2

Related Questions