From: Roland Häder Date: Fri, 10 Apr 2020 19:45:36 +0000 (+0200) Subject: Product-only: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7f349bd01d01466147db80eab55b5a9d6923b0b7;p=jfinancials-war.git Product-only: - WIP: rewrote admin-list-users view into ViewScoped - rewrote cache initialization to avoid a local List copy Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java index 28b691a9..363bad42 100644 --- a/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java @@ -120,7 +120,7 @@ public class FinancialsProductListWebViewBean extends BaseFinancialsBean impleme * @param event Updated product data event */ public void afterProductUpdatedEvent (@Observes final ObservableProductUpdatedEvent event) { - // event should not be null + // Event and contained entity instance should not be null if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N @@ -216,11 +216,8 @@ public class FinancialsProductListWebViewBean extends BaseFinancialsBean impleme public void init () { // Is cache there? if (!this.productCache.iterator().hasNext()) { - // Get whole list from EJB - final List products = this.productBean.allProducts(); - // "Walk" through all entries and add to cache - for (final Product product : products) { + for (final Product product : this.productBean.allProducts()) { // Add it by primary key this.productCache.put(product.getProductId(), product); } diff --git a/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java index 0416b3d5..9b2b22a8 100644 --- a/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java @@ -191,11 +191,8 @@ public class FinancialsCategoryListWebViewBean extends BaseFinancialsBean implem public void init () { // Is cache there? if (!this.categoryCache.iterator().hasNext()) { - // Get whole list from EJB - final List categories = this.categoryBean.allCategories(); - // "Walk" through all entries and add to cache - for (final Category category : categories) { + for (final Category category : this.categoryBean.allCategories()) { // Add it by primary key this.categoryCache.put(category.getCategoryId(), category); }