From 12ff06c9d8859c5bfa79c2e03748304433a66527 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 Aug 2016 18:02:37 +0200 Subject: [PATCH] Please cherry-pick: - called new detach method --- ...dressbookAdminContactPhoneSessionBean.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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); -- 2.39.5