From: Roland Häder Date: Fri, 24 Apr 2020 21:16:12 +0000 (+0200) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4de955e2f49c72d8feca94d14601af1321faf5c2;p=jfinancials-ejb.git Don't cherry-pick: - set foo-updated on the detached instance, not on managed - renamed variables Signed-off-by: Roland Häder --- 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;