From 4de955e2f49c72d8feca94d14601af1321faf5c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Apr 2020 23:16:12 +0200 Subject: [PATCH] Don't cherry-pick: - set foo-updated on the detached instance, not on managed - renamed variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../receipt/BaseFinancialsReceiptEnterpriseBean.java | 6 ++---- .../BaseFinancialsReceiptItemEnterpriseBean.java | 6 ++---- .../model/receipt/FinancialAdminReceiptSessionBean.java | 6 +++--- .../receipt_item/FinancialAdminReceiptItemSessionBean.java | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java index 40e5f20..0c0b503 100644 --- a/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java +++ b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java @@ -65,7 +65,8 @@ public abstract class BaseFinancialsReceiptEnterpriseBean extends BaseFinancials } // Set updated timestamp - // @TODO detachedReceipt.setReceiptUpdated(new Date()); + detachedReceipt.setReceiptEntryUpdated(new Date()); + // Get receipt from it and find it final BillableReceipt foundReceipt = this.getEntityManager().find(detachedReceipt.getClass(), detachedReceipt.getReceiptId()); @@ -81,9 +82,6 @@ public abstract class BaseFinancialsReceiptEnterpriseBean extends BaseFinancials // Merge receipt instance final BillableReceipt managedReceipt = this.getEntityManager().merge(foundReceipt); - // Set updated timestamp - managedReceipt.setReceiptEntryUpdated(new Date()); - // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeReceipt: managedReceipt={0} - EXIT!", managedReceipt)); //NOI18N diff --git a/src/java/org/mxchange/jfinancials/enterprise/financial/receipt_item/BaseFinancialsReceiptItemEnterpriseBean.java b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt_item/BaseFinancialsReceiptItemEnterpriseBean.java index ad06ce1..51e27e8 100644 --- a/src/java/org/mxchange/jfinancials/enterprise/financial/receipt_item/BaseFinancialsReceiptItemEnterpriseBean.java +++ b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt_item/BaseFinancialsReceiptItemEnterpriseBean.java @@ -65,7 +65,8 @@ public abstract class BaseFinancialsReceiptItemEnterpriseBean extends BaseFinanc } // Set updated timestamp - // @TODO detachedReceipt.setReceiptUpdated(new Date()); + detachedReceiptItem.setItemEntryUpdated(new Date()); + // Get receipt from it and find it final BillableReceiptItem foundReceiptItem = this.getEntityManager().find(detachedReceiptItem.getClass(), detachedReceiptItem.getItemId()); @@ -81,9 +82,6 @@ public abstract class BaseFinancialsReceiptItemEnterpriseBean extends BaseFinanc // Merge receipt item instance final BillableReceiptItem managedReceiptItem = this.getEntityManager().merge(foundReceiptItem); - // Set updated timestamp - managedReceiptItem.setItemEntryUpdated(new Date()); - // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeReceiptItem: managedReceiptItem={0} - EXIT!", managedReceiptItem)); //NOI18N diff --git a/src/java/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBean.java b/src/java/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBean.java index 9a4b692..0fd9e3a 100644 --- a/src/java/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBean.java +++ b/src/java/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBean.java @@ -171,13 +171,13 @@ public class FinancialAdminReceiptSessionBean extends BaseFinancialsReceiptEnter } // Merge data - final BillableReceipt managedReceipt = this.mergeReceipt(receipt); + final BillableReceipt updatedReceipt = this.mergeReceipt(receipt); // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): managedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), managedReceipt.getReceiptId())); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): updatedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), updatedReceipt.getReceiptId())); //NOI18N // Return it - return managedReceipt; + return updatedReceipt; } } diff --git a/src/java/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBean.java b/src/java/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBean.java index 61a239c..b85d41d 100644 --- a/src/java/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBean.java +++ b/src/java/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBean.java @@ -138,7 +138,7 @@ public class FinancialAdminReceiptItemSessionBean extends BaseFinancialsReceiptI final BillableReceiptItem updatedReceiptItem = this.mergeReceiptItem(receiptItem); // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceiptItem(): updatedReceiptItem={1} - CALLED!", this.getClass().getSimpleName(), updatedReceiptItem)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceiptItem(): updatedReceiptItem.itemId={1} - EXIT!", this.getClass().getSimpleName(), updatedReceiptItem.getItemId())); //NOI18N // Return it return updatedReceiptItem; -- 2.39.5