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

src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java

index c8ffce0a7cf967b8fa97aec506bddf586d6d206c..7c993965d4c0c2b2300ac466fd205a88fa47e7c6 100644 (file)
@@ -325,6 +325,24 @@ public abstract class BaseJobsDatabaseBean 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());