From: Roland Häder Date: Mon, 22 Aug 2016 15:42:54 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82db208fec38598e36b5fa7982e6ca6a5c7c03a3;p=pizzaservice-ejb.git Please cherry-pick: - when updating contact data, detach all other referenced instances, else new entries are being created each update-time --- diff --git a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java index 63d9261..2e09138 100644 --- a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java @@ -17,6 +17,7 @@ package org.mxchange.jcontacts.contact; import java.text.MessageFormat; +import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; import java.util.Objects; @@ -283,7 +284,10 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co } // Set updated timestamp - this.setAllContactPhoneEntriesUpdated(contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked); + contact.setContactUpdated(new GregorianCalendar()); + + // Detach all phone numbers + this.detachAllContactPhoneEntries(contact); // Merge cellphone, land-line and fix Contact detachedContact = this.mergeContactData(contact);