]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Product-only:
authorRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 06:27:51 +0000 (08:27 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 06:27:51 +0000 (08:27 +0200)
- set productEntryUpdated when update business method has finished
- detachedProduct is misleading as it is a managed (JPA) instance

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/enterprise/product/BaseFinancialsProductEnterpriseBean.java
src/java/org/mxchange/jproduct/model/product/FinancialsAdminGenericProductSessionBean.java

index 3c5788bda7716901fb0fe6ce700d1956983136ae..aee55220cd975d22bbca5559ee34aa18edb8cf9b 100644 (file)
@@ -124,7 +124,7 @@ public abstract class BaseFinancialsProductEnterpriseBean extends BaseFinancials
         * <p>
         * @param detachedProduct Product instance to merge
         * <p>
-        * @return Detached product instance
+        * @return Managed product instance
         */
        protected Product mergeProductData (final Product detachedProduct) {
                // Trace message
index 982e45818fe755b03db326d42fa64eab48ea0fa2..4cd08166e5fd02bccec82269994aa6d5008b8f13 100644 (file)
@@ -101,7 +101,7 @@ public class FinancialsAdminGenericProductSessionBean extends BaseFinancialsProd
                }
 
                // Set created instance
-               product.setProductCreated(new Date());
+               product.setProductEntryCreated(new Date());
 
                // Persist it
                this.getEntityManager().persist(product);
@@ -134,13 +134,16 @@ public class FinancialsAdminGenericProductSessionBean extends BaseFinancialsProd
                }
 
                // Merge data
-               final Product detachedProduct = this.mergeProductData(product);
+               final Product managedProduct = this.mergeProductData(product);
+
+               // Set updated instance
+               managedProduct.setProductEntryUpdated(new Date());
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateProductData: detachedProduct={1} - EXIT!", this.getClass().getSimpleName(), detachedProduct)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateProductData: managedProduct={1} - EXIT!", this.getClass().getSimpleName(), managedProduct)); //NOI18N
 
                // Return it
-               return detachedProduct;
+               return managedProduct;
        }
 
        /**