From: Roland Häder Date: Fri, 26 Aug 2016 15:04:33 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a1954e4da7400145c193a32ad6308c78683c1764;p=pizzaservice-core.git Please cherry-pick: - use find() and and not getReference()/merge() --- diff --git a/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java b/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java index bb4abd8..17e2b0d 100644 --- a/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java +++ b/src/org/mxchange/pizzaaplication/database/BasePizzaDatabaseBean.java @@ -360,16 +360,13 @@ public abstract class BasePizzaDatabaseBean extends BaseDatabaseBean { } // Get contact from it and find it - Contact foundContact = this.getEntityManager().getReference(detachedContact.getClass(), detachedContact.getContactId()); + Contact managedContact = this.getEntityManager().find(detachedContact.getClass(), detachedContact.getContactId()); // Should be found - assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N + assert (managedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N // Debug message - this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: foundContact.contactId={1}", this.getClass().getSimpleName(), foundContact.getContactId())); //NOI18N - - // Merge contact instance - Contact managedContact = this.getEntityManager().merge(foundContact); + this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: managedContact.contactId={1}", this.getClass().getSimpleName(), managedContact.getContactId())); //NOI18N // Is a fax number set? if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) {