From: Roland Häder Date: Fri, 19 Aug 2016 16:02:37 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=12ff06c9d8859c5bfa79c2e03748304433a66527;p=jjobs-mailer-ejb.git Please cherry-pick: - called new detach method --- diff --git a/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java index a23d9b3..e782f9c 100644 --- a/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java @@ -96,6 +96,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set fax number in contact contact.setContactFaxNumber(faxNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -153,6 +156,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set land-line number in contact contact.setContactLandLineNumber(landLineNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -204,6 +210,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set mobile number in contact contact.setContactMobileNumber(mobileNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -261,6 +270,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set fax number in contact contact.setContactFaxNumber(faxNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -318,6 +330,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set landLine number in contact contact.setContactLandLineNumber(landLineNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -369,6 +384,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Set mobile number in contact contact.setContactMobileNumber(mobileNumber); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -411,6 +429,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Remove it from contact contact.setContactFaxNumber(null); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -453,6 +474,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Remove it from contact contact.setContactLandLineNumber(null); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact); @@ -495,6 +519,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Remove it from contact contact.setContactMobileNumber(null); + // Detach all phone entries before persisting it + this.detachAllContactPhoneEntries(contact); + // Update database Contact updatedContact = this.contactBean.updateContactData(contact);