]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Maybe cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 29 Oct 2017 22:56:40 +0000 (23:56 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Oct 2017 22:56:40 +0000 (23:56 +0100)
- i18n key is localizable, not the direct category title

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java
src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java

index df1f961f1ecbc11472b8a70c55a1f76334715c9a..6331338df66fe9959b9cc70ccb53acffe5a4e5b9 100644 (file)
@@ -51,10 +51,10 @@ public abstract class BaseFinancialsProductDatabaseBean extends BaseFinancialsDa
                if (null == category) {
                        // Throw NPE
                        throw new NullPointerException("category is null");
-               } else if(category.getCategoryTitle() == null) {
+               } else if(category.getCategoryI18nKey() == null) {
                        // Throw it again
                        throw new NullPointerException("category.categoryTitle is null");
-               } else if (category.getCategoryTitle().isEmpty()) {
+               } else if (category.getCategoryI18nKey().isEmpty()) {
                        // Throw it again
                        throw new IllegalArgumentException("category.categoryTitle is empty");
                } else if(category.getCategoryId() == null) {
index 8d5cbc065609821af8d53e7221f3f455a06cbcc7..2766a5bc5a4b43d449b1c41f5e34c5a655dcb91b 100644 (file)
@@ -61,10 +61,10 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro
                if (null == category) {
                        // Throw NPE
                        throw new NullPointerException("category is null"); //NOI18N
-               } else if (category.getCategoryTitle() == null) {
+               } else if (category.getCategoryI18nKey() == null) {
                        // Throw it again
                        throw new NullPointerException("category.categoryTitle is null"); //NOI18N
-               } else if (category.getCategoryTitle().isEmpty()) {
+               } else if (category.getCategoryI18nKey().isEmpty()) {
                        // Throw it again
                        throw new IllegalArgumentException("category.categoryTitle is empty"); //NOI18N
                } else if (category.getCategoryId() != null) {
@@ -109,10 +109,10 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro
                if (null == category) {
                        // Throw NPE
                        throw new NullPointerException("category is null"); //NOI18N
-               } else if (category.getCategoryTitle() == null) {
+               } else if (category.getCategoryI18nKey() == null) {
                        // Throw it again
                        throw new NullPointerException("category.categoryTitle is null"); //NOI18N
-               } else if (category.getCategoryTitle().isEmpty()) {
+               } else if (category.getCategoryI18nKey().isEmpty()) {
                        // Throw it again
                        throw new IllegalArgumentException("category.categoryTitle is empty"); //NOI18N
                } else if (category.getCategoryId() != null) {
@@ -129,7 +129,7 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro
                // Check each entry
                for (final Category createdCategory : list) {
                        // Is same name?
-                       if (Objects.equals(createdCategory.getCategoryTitle(), category.getCategoryTitle())) {
+                       if (Objects.equals(createdCategory.getCategoryI18nKey(), category.getCategoryI18nKey())) {
                                // Found it, then stop here
                                isFound = true;
                                break;