]> git.mxchange.org Git - jjobs-core.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 26 Aug 2016 15:04:33 +0000 (17:04 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 28 Aug 2016 13:55:31 +0000 (15:55 +0200)
- use find() and and not getReference()/merge()

src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java

index efc4228d09f6857fb1216da35651d56b6ec1b19f..5f8e990f0e6380d049608e52357d0d0a7037d0b2 100644 (file)
@@ -360,16 +360,13 @@ public abstract class BaseJobsDatabaseBean 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) {