- 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>
* <p>
* @param detachedProduct Product instance to merge
* <p>
* <p>
* @param detachedProduct Product instance to merge
* <p>
- * @return Detached product instance
+ * @return Managed product instance
*/
protected Product mergeProductData (final Product detachedProduct) {
// Trace message
*/
protected Product mergeProductData (final Product detachedProduct) {
// Trace message
}
// Set created instance
}
// Set created instance
- product.setProductCreated(new Date());
+ product.setProductEntryCreated(new Date());
// Persist it
this.getEntityManager().persist(product);
// Persist it
this.getEntityManager().persist(product);
- final Product detachedProduct = this.mergeProductData(product);
+ final Product managedProduct = this.mergeProductData(product);
+
+ // Set updated instance
+ managedProduct.setProductEntryUpdated(new Date());
- 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 detachedProduct;