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=b642d2453fe53108d48e7e15392c00884882d6ae;p=pizzaservice-ejb.git Please cherry-pick: - called new detach method --- diff --git a/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java index 96754d1..3cc997c 100644 --- a/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java @@ -96,6 +96,9 @@ public class PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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);