From 878e5a5fe59eef4a91510eb3fa00e5ee0c85d7a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 20 May 2020 20:34:41 +0200 Subject: [PATCH] Please cherry-pick: - always set EntryUpdated in the managed (and merged) instance, as the copyFooData() methods do no longer copy timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../BaseFinancialsEnterpriseBean.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 -- 2.39.5