Namita
Namita

Reputation: 779

Setting the value of a domain class defined in differen domain

I have two domain classes (getter setter of two tables): Contact Information and Address. I have some fields in Contact Information and some fields in Address.

I'm setting the values of the contact information in the controller class but I need to set the values of fields in Address class via Contact Information.

Code:

class ContactInformation {

String id;
String name;

Address address;

//getter and setters

}

And

Class Address{

String idAddress;
...
...
//getter and setter

}

In Controller class

I am setting the values like

contactInformation.setId("some value");

How do i set the value of idAddress via ContactInformation?

Upvotes: 0

Views: 109

Answers (1)

Adel Boutros
Adel Boutros

Reputation: 10285

contactInformation.getAddress().setIdAddress(id)

Upvotes: 4

Related Questions