From: Roland Häder Date: Wed, 20 May 2020 18:34:41 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=878e5a5fe59eef4a91510eb3fa00e5ee0c85d7a8;p=jfinancials-ejb.git Please cherry-pick: - always set EntryUpdated in the managed (and merged) instance, as the copyFooData() methods do no longer copy timestamps Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/enterprise/BaseFinancialsEnterpriseBean.java b/src/java/org/mxchange/jfinancials/enterprise/BaseFinancialsEnterpriseBean.java index 2a19807..08ac556 100644 --- a/src/java/org/mxchange/jfinancials/enterprise/BaseFinancialsEnterpriseBean.java +++ b/src/java/org/mxchange/jfinancials/enterprise/BaseFinancialsEnterpriseBean.java @@ -757,9 +757,6 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { throw new IllegalStateException(MessageFormat.format("detachedBranchOffice.branchId ={0} is not valid.", detachedBranchOffice.getBranchId())); //NOI18N } - // Set updated timestamp - detachedBranchOffice.setBranchEntryUpdated(new Date()); - // Get contact from it and find it final BranchOffice foundBranchOffice = this.getEntityManager().find(detachedBranchOffice.getClass(), detachedBranchOffice.getBranchId()); @@ -775,6 +772,9 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { // Merge contact instance final BranchOffice managedBranchOffice = this.getEntityManager().merge(foundBranchOffice); + // Set updated timestamp + managedBranchOffice.setBranchEntryUpdated(new Date()); + // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeBranchOfficeData: managedBranchOffice={0} - EXIT!", managedBranchOffice)); //NOI18N @@ -805,9 +805,6 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { throw new IllegalStateException(MessageFormat.format("detachedContact.contactId={0} is not valid.", detachedContact.getContactId())); //NOI18N } - // Set updated timestamp - detachedContact.setContactEntryUpdated(new Date()); - // Get contact from it and find it final Contact foundContact = this.createManaged(detachedContact); @@ -820,6 +817,9 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { // Merge contact instance final Contact managedContact = this.getEntityManager().merge(foundContact); + // Set updated timestamp + managedContact.setContactEntryUpdated(new Date()); + // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: managedContact={0} - EXIT!", managedContact)); //NOI18N @@ -952,9 +952,6 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { throw new IllegalStateException(MessageFormat.format("detachedDepartment.departmentId ={0} is not valid.", detachedDepartment.getDepartmentId())); //NOI18N } - // Set updated timestamp - detachedDepartment.setDepartmentEntryUpdated(new Date()); - // Get contact from it and find it final Department foundDepartment = this.createManaged(detachedDepartment); @@ -967,6 +964,9 @@ public abstract class BaseFinancialsEnterpriseBean extends BaseEnterpriseBean { // Merge contact instance final Department managedDepartment = this.getEntityManager().merge(foundDepartment); + // Set updated timestamp + managedDepartment.setDepartmentEntryUpdated(new Date()); + // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeDepartmentData: managedDepartment={0} - EXIT!", managedDepartment)); //NOI18N