]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 15:03:39 +0000 (17:03 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 15:03:39 +0000 (17:03 +0200)
- ops, don't update itemEntryCreated in update phase, why is that still possible?!
- set itemEntryUpdated when update business method is invoked

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/enterprise/financial/BaseFinancialsProjectEnterpriseBean.java
src/java/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBean.java
src/java/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBean.java
src/java/org/mxchange/jfinancials/model/receipt_item/FinancialReceiptItemSessionBean.java

index 9e3f3e32e4f00b9f9a29dc2edc8d0cbc193dfd86..211200a9673c140241cf24a5329e3c88fff2ae73 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jfinancials.enterprise.financial;
 
 import java.text.MessageFormat;
+import java.util.Date;
 import org.mxchange.jfinancials.enterprise.BaseFinancialsEnterpriseBean;
 import org.mxchange.jfinancials.model.receipt.BillableReceipt;
 import org.mxchange.jfinancials.model.receipt.Receipts;
@@ -80,6 +81,9 @@ public abstract class BaseFinancialsProjectEnterpriseBean extends BaseFinancials
                // Merge receipt instance
                final BillableReceipt managedReceipt = this.getEntityManager().merge(foundReceipt);
 
+               // Set updated timestamp
+               managedReceipt.setReceiptUpdated(new Date());
+
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeReceipt: managedReceipt={0} - EXIT!", managedReceipt)); //NOI18N
 
index c68362e1d47afb74abda6c0dd0a09765a1b17e5c..05030baa454312883cd1033dcfed42fd28928b76 100644 (file)
@@ -152,9 +152,6 @@ public class FinancialAdminReceiptSessionBean extends BaseFinancialsProjectEnter
                        throw new ReceiptNotFoundException(receipt);
                }
 
-               // Add created instance
-               receipt.setReceiptCreated(new Date());
-
                // Is user instance set?
                if (receipt.getReceiptUser() instanceof User) {
                        // Then get managed instanced
@@ -173,17 +170,14 @@ public class FinancialAdminReceiptSessionBean extends BaseFinancialsProjectEnter
                        receipt.setReceiptSellerEmployee(managedEmployee);
                }
 
-               // Set updated timestamp
-               receipt.setReceiptUpdated(new Date());
-
                // Merge data
-               final BillableReceipt detachedReceipt = this.mergeReceipt(receipt);
+               final BillableReceipt managedReceipt = this.mergeReceipt(receipt);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): detachedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), detachedReceipt.getReceiptId())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): managedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), managedReceipt.getReceiptId())); //NOI18N
 
                // Return it
-               return detachedReceipt;
+               return managedReceipt;
        }
 
 }
index e3961b54bfe10b7585215cde0a574046b1da4b45..a2fd02650e3954daeb5e6fba7d74f3a688aea244 100644 (file)
@@ -98,7 +98,7 @@ public class FinancialAdminReceiptItemSessionBean extends BaseFinancialsProductE
                }
 
                // Add created timestamp
-               receiptItem.setItemCreated(new Date());
+               receiptItem.setItemEntryCreated(new Date());
 
                // Persist it
                this.getEntityManager().persist(receiptItem);
index fe0ede04e8ef24893a2591a7b2102155bde5f55c..5b5d4e2a71ab9ed902002e8ef740514e46cac9a0 100644 (file)
@@ -78,7 +78,7 @@ public class FinancialReceiptItemSessionBean extends BaseFinancialsEnterpriseBea
                }
 
                // Add created timestamp
-               receiptItem.setItemCreated(new Date());
+               receiptItem.setItemEntryCreated(new Date());
 
                // Persist it
                this.getEntityManager().persist(receiptItem);