From: Roland Häder Date: Sun, 29 Oct 2017 22:56:40 +0000 (+0100) Subject: Maybe cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b244668cc1caaaffec4d1f356b6a961973f4d3d;p=jfinancials-ejb.git Maybe cherry-pick: - i18n key is localizable, not the direct category title Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java b/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java index df1f961..6331338 100644 --- a/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java +++ b/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java @@ -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) { diff --git a/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java b/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java index 8d5cbc0..2766a5b 100644 --- a/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java +++ b/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java @@ -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;