From 2d9f9ece7b30a24e9ff43dceb1d85237b17335e7 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 14 Aug 2015 21:23:32 +0200 Subject: [PATCH] =?utf8?q?Added=20missing=20thrown=20exceptions=20Signed-o?= =?utf8?q?ff-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../bean/PizzaServiceCustomerBean.java | 2 +- .../PizzaCategoryDatabaseFrontend.java | 19 +++++++-------- .../pizzaapplication/product/BaseProduct.java | 23 ++++++++++++++++--- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/customer/bean/PizzaServiceCustomerBean.java b/src/java/org/mxchange/pizzaapplication/customer/bean/PizzaServiceCustomerBean.java index 276cdf3f..e68c9828 100644 --- a/src/java/org/mxchange/pizzaapplication/customer/bean/PizzaServiceCustomerBean.java +++ b/src/java/org/mxchange/pizzaapplication/customer/bean/PizzaServiceCustomerBean.java @@ -262,7 +262,7 @@ public class PizzaServiceCustomerBean extends BasePizzaServiceSystem implements } @Override - public void setValueFromColumn (String columnName, String value) { + public void setValueFromColumn (String columnName, String value) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Deligate to "hidden" object this.getContact().setValueFromColumn(columnName, value); } diff --git a/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java b/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java index 39278cd0..aa376c77 100644 --- a/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java +++ b/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java @@ -17,6 +17,7 @@ package org.mxchange.pizzaapplication.database.frontend.category; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.sql.ResultSet; import java.sql.SQLException; import java.text.MessageFormat; @@ -220,28 +221,28 @@ public class PizzaCategoryDatabaseFrontend extends BaseDatabaseFrontend implemen public boolean isCategoryTitleUsed (final String title) throws IOException, SQLException, BadTokenException, CorruptedDatabaseFileException { // Trace message this.getLogger().trace(MessageFormat.format("title={0} - CALLED!", title)); - + // Get search criteria SearchableCritera criteria = new SearchCriteria(); - + // Add criteria criteria.addCriteria(PizzaCategoryDatabaseConstants.COLUMN_TITLE, title); - + // Only one entry is find criteria.setLimit(1); - + // Run it on backend Result result = this.getBackend().doSelectByCriteria(criteria); - + // Debug log this.getLogger().debug(MessageFormat.format("result({0}={1}", result, result.size())); - + // Now check size of the result boolean isFound = (result.size() == 1); - + // Trace message this.getLogger().trace(MessageFormat.format("isFound={0} - EXIT!", isFound)); - + // Return it return isFound; } @@ -255,7 +256,7 @@ public class PizzaCategoryDatabaseFrontend extends BaseDatabaseFrontend implemen * @return An instance of a Storeable implementation */ @Override - public Storeable toStoreable (final Map map) { + public Storeable toStoreable (final Map map) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // Trace message this.getLogger().trace("map=" + map + " - CALLED!"); diff --git a/src/java/org/mxchange/pizzaapplication/product/BaseProduct.java b/src/java/org/mxchange/pizzaapplication/product/BaseProduct.java index 453cf4e7..7d732948 100644 --- a/src/java/org/mxchange/pizzaapplication/product/BaseProduct.java +++ b/src/java/org/mxchange/pizzaapplication/product/BaseProduct.java @@ -168,11 +168,28 @@ public class BaseProduct extends BaseFrameworkSystem implements Product { @Override public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - throw new UnsupportedOperationException("Not supported yet:columnName=" + columnName); + // Trace message + this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); + + // Call super method + Object value = this.getValueInStoreableFromColumn(this, "BaseProduct", columnName); + + // Trace message + this.getLogger().trace("value=" + value + " - EXIT!"); + + // Return value + return value; } @Override - public void setValueFromColumn (final String columnName, final String value) { - throw new UnsupportedOperationException("Not supported yet: columnName=" + columnName + ",value=" + value); + public void setValueFromColumn (final String columnName, final String value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // Trace message + this.getLogger().trace(MessageFormat.format("columnName={0},value={1} - CALLED!", columnName, value)); + + // Call super method + this.setValueInStoreableFromColumn(this, "BaseProduct", columnName, value); + + // Trace message + this.getLogger().trace("EXIT!"); } } -- 2.39.5