]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 20 May 2020 18:37:11 +0000 (20:37 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 20 May 2020 18:37:11 +0000 (20:37 +0200)
- always set EntryUpdated in the managed (and merged) instance, as the
  copyFooData() methods do no longer copy timestamps

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/enterprise/financial/receipt/BaseFinancialsReceiptEnterpriseBean.java
src/java/org/mxchange/jfinancials/enterprise/financial/receipt_item/BaseFinancialsReceiptItemEnterpriseBean.java

index a36c4ca9033974ddd0e43e962d9336b6d4dce7fd..92864cf015ccea376fc94b32588339715a26cfa5 100644 (file)
@@ -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
 
index cf4ac8abc48bf2d5b77c57545d4883c316bb1785..719a028c2062fc50605d9c055734d0b23d04d8c6 100644 (file)
@@ -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