]> git.mxchange.org Git - pizzaservice-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 18:14:11 +0000 (20:14 +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/jproduct/model/product/PizzaAdminGenericProductSessionBean.java
src/java/org/mxchange/pizzaapplication/enterprise/product/BasePizzaProductEnterpriseBean.java

index c82ecd503b3e909a3c3bd53429cdc6508a6919bc..3bc68cefbffd948a39c4753916a837d8ce5abc60 100644 (file)
@@ -101,7 +101,7 @@ public class PizzaAdminGenericProductSessionBean extends BasePizzaProductEnterpr
                }
 
                // Set created instance
-               product.setProductCreated(new Date());
+               product.setProductEntryCreated(new Date());
 
                // Persist it
                this.getEntityManager().persist(product);
@@ -134,13 +134,16 @@ public class PizzaAdminGenericProductSessionBean extends BasePizzaProductEnterpr
                }
 
                // 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;
        }
 
        /**
index dbb93bc113d1c5186a6229cdbba1c51516b797ab..def6fa52f20e619e843baa8b4938a73bfb87b0ae 100644 (file)
@@ -124,7 +124,7 @@ public abstract class BasePizzaProductEnterpriseBean extends BasePizzaEnterprise
         * <p>
         * @param detachedProduct Product instance to merge
         * <p>
-        * @return Detached product instance
+        * @return Managed product instance
         */
        protected Product mergeProductData (final Product detachedProduct) {
                // Trace message