From: Roland Häder Date: Wed, 20 May 2020 18:37:11 +0000 (+0200) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f3da3017282330fc75a32454c917f92aae88ba67;p=jfinancials-ejb.git Don't 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/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java index a36c4ca..92864cf 100644 --- a/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java +++ b/src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java @@ -64,9 +64,6 @@ public abstract class BaseFinancialsReceiptEnterpriseBean extends BaseFinancials throw new IllegalStateException(MessageFormat.format("detachedReceipt.receiptId={0} is not valid.", detachedReceipt.getReceiptId())); //NOI18N } - // Set updated timestamp - detachedReceipt.setReceiptEntryUpdated(new Date()); - // Get receipt from it and find it final BillableReceipt foundReceipt = this.getEntityManager().find(detachedReceipt.getClass(), detachedReceipt.getReceiptId()); @@ -82,6 +79,12 @@ public abstract class BaseFinancialsReceiptEnterpriseBean extends BaseFinancials // Merge receipt instance final BillableReceipt managedReceipt = this.getEntityManager().merge(foundReceipt); + // Should be there + assert (managedReceipt instanceof BillableReceipt) : "managedReceipt is null"; //NOI18N + + // 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 cf4ac8a..719a028 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 @@ -64,9 +64,6 @@ public abstract class BaseFinancialsReceiptItemEnterpriseBean extends BaseFinanc throw new IllegalStateException(MessageFormat.format("detachedReceipt.itemId={0} is not valid.", detachedReceiptItem.getItemId())); //NOI18N } - // Set updated timestamp - detachedReceiptItem.setItemEntryUpdated(new Date()); - // Get receipt from it and find it final BillableReceiptItem foundReceiptItem = this.getEntityManager().find(detachedReceiptItem.getClass(), detachedReceiptItem.getItemId()); @@ -82,6 +79,12 @@ public abstract class BaseFinancialsReceiptItemEnterpriseBean extends BaseFinanc // Merge receipt item instance final BillableReceiptItem managedReceiptItem = this.getEntityManager().merge(foundReceiptItem); + // Should be there + assert (managedReceiptItem instanceof BillableReceiptItem) : "managedReceiptItem is null"; //NOI18N + + // Set updated timestamp + managedReceiptItem.setItemEntryUpdated(new Date()); + // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeReceiptItem: managedReceiptItem={0} - EXIT!", managedReceiptItem)); //NOI18N