]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Product-only:
authorRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:45:36 +0000 (21:45 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:45:36 +0000 (21:45 +0200)
- WIP: rewrote admin-list-users view into ViewScoped
- rewrote cache initialization to avoid a local List<Entity> copy

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java

index 28b691a9b6cbfcf15776b58296e05ca78c5b0578..363bad429c9f7fc232b81de532b7c120f8f23c0a 100644 (file)
@@ -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<Product> 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);
                        }
index 0416b3d5a8b744a080fa7c8d8eb00e08e15c7a80..9b2b22a8bc99e08c4c03071911a62f4af94368ed 100644 (file)
@@ -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<Category> 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);
                        }