From: Roland Häder Date: Wed, 24 Aug 2016 09:08:27 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5944b35e05706db0beec100472902ef5a98ee7b5;p=addressbook-core.git Please cherry-pick: - unsetting all phone numbers make them disconnected from the contact instance, better is to make them managed (merge) --- diff --git a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java index f5d4310..02922c5 100644 --- a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java +++ b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java @@ -273,6 +273,24 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean { // Merge contact instance Contact managedContact = this.getEntityManager().merge(foundContact); + // Is a fax number set? + if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) { + // Make fax numbers managed + managedContact.setContactFaxNumber(this.getManaged(detachedContact.getContactFaxNumber(), detachedContact.getContactFaxNumber())); + } + + // Is a land-line number set? + if (detachedContact.getContactLandLineNumber() instanceof DialableLandLineNumber) { + // Make land-line numbers managed + managedContact.setContactLandLineNumber(this.getManaged(detachedContact.getContactLandLineNumber(), detachedContact.getContactLandLineNumber())); + } + + // Is a mobile number set? + if (detachedContact.getContactMobileNumber() instanceof DialableMobileNumber) { + // Make mobile numbers managed + managedContact.setContactMobileNumber(this.getManaged(detachedContact.getContactMobileNumber(), detachedContact.getContactMobileNumber())); + } + // Set updated timestamp managedContact.setContactUpdated(new GregorianCalendar());