From 4a065e77c2784e4c91823f2cbe0124de7f7e5be6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 20 May 2020 20:36:39 +0200 Subject: [PATCH] Product-only: - 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 --- .../product/BaseFinancialsProductEnterpriseBean.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/enterprise/product/BaseFinancialsProductEnterpriseBean.java b/src/java/org/mxchange/jfinancials/enterprise/product/BaseFinancialsProductEnterpriseBean.java index a473bed..5817e13 100644 --- a/src/java/org/mxchange/jfinancials/enterprise/product/BaseFinancialsProductEnterpriseBean.java +++ b/src/java/org/mxchange/jfinancials/enterprise/product/BaseFinancialsProductEnterpriseBean.java @@ -150,9 +150,6 @@ public abstract class BaseFinancialsProductEnterpriseBean extends BaseFinancials throw new IllegalStateException(MessageFormat.format("detachedProduct.productId={0} is not valid.", detachedProduct.getProductId())); //NOI18N } - // Set updated timestamp - detachedProduct.setProductEntryUpdated(new Date()); - // Get product from it and find it final Product foundProduct = this.createManaged(detachedProduct); @@ -165,6 +162,12 @@ public abstract class BaseFinancialsProductEnterpriseBean extends BaseFinancials // Merge product instance final Product managedProduct = this.getEntityManager().merge(foundProduct); + // Should be there + assert (managedProduct instanceof Product) : "managedProduct is null"; //NOI18N + + // Set updated timestamp + managedProduct.setProductEntryUpdated(new Date()); + // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeProductData: managedProduct={0} - EXIT!", managedProduct)); //NOI18N -- 2.39.5