Menu

#387 Mapping error if trying to access child object attributes

Dozer v5.3.3
open
nobody
None
5
2014-07-22
2014-05-14
Rajesh Meda
No

We are evaluating to see if we can use DOzer for our mapping needs. I have trouble in mapping below class structures.

My Source Class structure is as below:

Class Request{

ServiceRequest serviceReq ;
int requestId ;

}

Class ServiceRequest {

int Id ;

}

Class MyServiceRequest extends ServiceRequest{

String trace ;
MyRequestInfo myReqInfo ;

}

class MyRequestInfo {

String attribute1 ;
List<string> listOfAttributes</string>

}

My Target Class structure is as below:

Class TargetRequest{

int requestId ;
TargetRequestInfo requestInfo ;

}

Class TargetRequestInfo{

String attribute 1 ;
List<string> listOfAttributes;</string>

}

I am trying to map as below

<mapping></mapping>

<class-a>Request</class-a>
<class-b>TargetRequest</class-b>
<field>
    <a>serviceReq.myReqInfo</a>
    <b>requestInfo</b>
</field>

When i run the mapping code it says no getter/setter for serviceReq.myReqInfo

Not able to map it. Please help me on how to map this type of class structure.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB