]> git.mxchange.org Git - addressbook-core.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 26 Aug 2016 15:04:33 +0000 (17:04 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2017 19:38:39 +0000 (21:38 +0200)
- use find() and and not getReference()/merge()

src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java

index f515d531ec3a560bf1a7fa80591568431d39d996..40c905fd7d9f12a9dceaaffd57df1909306e80d6 100644 (file)
@@ -308,16 +308,13 @@ public abstract class BaseAddressbookDatabaseBean 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) {