I usually do the following:
For each remote PhoneNumber object, I make an Ajax request . PhoneNumberRepository will take care of removing PhoneNumber
@Repository
public class PhoneNumberRepositoryImpl implements PhoneNumberRepository {
public void removePhoneNumber(PhoneNumber phoneNumber) {
}
}
Thus, the user will only contain a phone number that has not been deleted.
Here you can see how to remove / add a property based on a collection. It works great!
Yours faithfully,
source
share