I have ClientDetails as bean with below structure:
public class ClientDetails{
protected String id;
protected String type;
protected AddressDetails;
protected PhoneDetails;
//getters and setters follows...
}
public class AddressDetails{
protected List<Address> address
//getters and setters follows...
}
public Address{
protected String addressType;
protected String line1;
protected String line2;
protected String line3;
//getters and setters follows...
}
public PhoneDetails{
protected List<PhoneDetail> phoneDetail;
//getters and setters follows...
}
public class PhoneDetail {
protected String type;
protected String phoneNumber;
//getters and setters follows...
}
Tables in database: ClientDetails, AddressDetails, PhoneDetails.
I will be recieving List of ClientDetails in service layer and have to always update ClientDetails table. AddressDetails, PhoneDetails will be optionally updated(if not null). How can i map this effectively in ibatis?