]> git.mxchange.org Git - addressbook-core.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 24 Aug 2016 09:08:27 +0000 (11:08 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2017 19:38:38 +0000 (21:38 +0200)
- unsetting all phone numbers make them disconnected from the contact instance, better is to make them managed (merge)

src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java

index f5d4310b1444c2923fcbf8976ac1a4a85c57577e..02922c5acfb2b83e18b3ef30c73ec3dbaceac336 100644 (file)
@@ -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());