]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:46:10 +0000 (21:46 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:46:10 +0000 (21:46 +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/financial/model/receipt/list/FinancialsReceiptListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/financial/model/receipt/user/FinancialsReceiptUserWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/list/FinancialsReceiptItemListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/user/FinancialsReceiptItemUserWebSessionBean.java
web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl
web/admin/financial/receipt/admin_receipt_list.xhtml

index 1afa4fbea170ab78c69ab21287a028fb0864e4f4..ed562fb9c941371ee3d93d383dc681f559908ee9 100644 (file)
@@ -235,11 +235,8 @@ public class FinancialsReceiptListWebViewBean extends BaseFinancialsBean impleme
        public void initCache () {
                // Is cache there?
                if (!this.receiptCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<BillableReceipt> receipts = this.receiptBean.allReceipts();
-
                        // Add all
-                       for (final BillableReceipt receipt : receipts) {
+                       for (final BillableReceipt receipt : this.receiptBean.allReceipts()) {
                                // Add it to cache
                                this.receiptCache.put(receipt.getReceiptId(), receipt);
                        }
index 8062eaf2051f61e7abdf3942b58f22dc90b12016..5e3ee7f41ad1275f7470c5a4d644e14a8f36c800 100644 (file)
@@ -107,7 +107,7 @@ public class FinancialsReceiptUserWebSessionBean extends BaseFinancialsBean impl
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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
index a9b5194a92fad031cdaf4a6aeb8c6db8119993be..20c7f566b14318aa800cbd5e066b3485d2715bbb 100644 (file)
@@ -132,7 +132,7 @@ public class FinancialsReceiptItemListWebViewBean extends BaseFinancialsBean imp
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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
@@ -205,11 +205,8 @@ public class FinancialsReceiptItemListWebViewBean extends BaseFinancialsBean imp
        public void initCache () {
                // Is cache there?
                if (!this.receiptItemCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<BillableReceiptItem> receiptItems = this.receiptItemBean.allReceiptItems();
-
                        // Add all
-                       for (final BillableReceiptItem receiptItem : receiptItems) {
+                       for (final BillableReceiptItem receiptItem : this.receiptItemBean.allReceiptItems()) {
                                // Add it to cache
                                this.receiptItemCache.put(receiptItem.getItemId(), receiptItem);
                        }
index 6ab06eda9620463be95b758797dd97edb2faa1b9..26af5364382f9badcb0a19f2458ac93d49d2a44f 100644 (file)
@@ -99,7 +99,7 @@ public class FinancialsReceiptItemUserWebSessionBean extends BaseFinancialsBean
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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
index c2adafd7abed3fa5e3310209e609a0d3115464b5..26dd238fd5c06b5226c3a12999486c89117edfc6 100644 (file)
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{userController.allUsers()}"
+                                       value="#{userListController.allUsers}"
                                        var="receiptUser"
                                        itemValue="#{receiptUser}"
                                        itemLabel="#{beanHelper.renderContact(receiptUser.userContact)} (#{receiptUser.userName})"
index f05185434a03b592826219f03cd3931d1aa0a5f4..ddd3de6f7dcdaf8188738be1c5fd9b07beaa6b6d 100644 (file)
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"