From 0c1fee15dbb911cc0c2816730278aa5ab98bbad1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 24 Aug 2016 11:08:27 +0200 Subject: [PATCH] Please cherry-pick: - unsetting all phone numbers make them disconnected from the contact instance, better is to make them managed (merge) --- .../database/BasePizzaDatabaseBean.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java b/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java index 1d2a559..13c801a 100644 --- a/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java +++ b/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java @@ -325,6 +325,24 @@ public abstract class BasePizzaDatabaseBean 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()); -- 2.39.5