From 7e715e2b44a6057f2e65af2644da6927f5440226 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 --- .../JobsAdminContactPhoneSessionBean.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/java/org/mxchange/jcontacts/phone/JobsAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/JobsAdminContactPhoneSessionBean.java index 6a5de67..8cea551 100644 --- a/src/java/org/mxchange/jcontacts/phone/JobsAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/JobsAdminContactPhoneSessionBean.java @@ -96,6 +96,9 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple // 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