From: Roland Haeder Date: Fri, 14 Aug 2015 20:27:24 +0000 (+0200) Subject: Ids must be parsed as Long, not Integer ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ce6c659b3f4278997584d46dd494983c8c6103b0;p=pizzaservice-war.git Ids must be parsed as Long, not Integer ... Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index c59185fe..a9a89d2e 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -1390,7 +1390,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } // Get parent id - Integer parent = category.getParent(); + Long parent = category.getParent(); // Is the id set? if (parent > 0) { diff --git a/src/java/org/mxchange/pizzaapplication/category/BaseCategory.java b/src/java/org/mxchange/pizzaapplication/category/BaseCategory.java index 54892128..8f40185a 100644 --- a/src/java/org/mxchange/pizzaapplication/category/BaseCategory.java +++ b/src/java/org/mxchange/pizzaapplication/category/BaseCategory.java @@ -31,12 +31,12 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { /** * Id number of category */ - private Integer id; + private Long id; /** * Parent category id */ - private Integer parent; + private Long parent; /** * Title of category @@ -49,7 +49,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { * @param title Category title * @param parent Parent id */ - protected BaseCategory (final Integer id, final String title, final Integer parent) { + protected BaseCategory (final Long id, final String title, final Long parent) { // Set all here this.setId(id); this.setTitle(title); @@ -113,7 +113,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { * @return the id */ @Override - public final Integer getId () { + public final Long getId () { return this.id; } @@ -122,7 +122,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { * @param id the id to set */ @Override - public final void setId (final Integer id) { + public final void setId (final Long id) { this.id = id; } @@ -131,7 +131,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { * @return the parent */ @Override - public final Integer getParent () { + public final Long getParent () { return this.parent; } @@ -140,7 +140,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category { * @param parent the parent to set */ @Override - public final void setParent (final Integer parent) { + public final void setParent (final Long parent) { this.parent = parent; } diff --git a/src/java/org/mxchange/pizzaapplication/category/Category.java b/src/java/org/mxchange/pizzaapplication/category/Category.java index 2ef80835..16b38a64 100644 --- a/src/java/org/mxchange/pizzaapplication/category/Category.java +++ b/src/java/org/mxchange/pizzaapplication/category/Category.java @@ -30,25 +30,25 @@ public interface Category extends Storeable, Comparable { * Id number of category * @return the id */ - public Integer getId (); + public Long getId (); /** * Id number of category * @param id the id to set */ - public void setId (final Integer id); + public void setId (final Long id); /** * Parent category id * @return the parent */ - public Integer getParent (); + public Long getParent (); /** * Parent category id * @param parent the parent to set */ - public void setParent (final Integer parent); + public void setParent (final Long parent); /** * Title of category diff --git a/src/java/org/mxchange/pizzaapplication/category/product/ProductCategory.java b/src/java/org/mxchange/pizzaapplication/category/product/ProductCategory.java index d4c2e249..8cf78445 100644 --- a/src/java/org/mxchange/pizzaapplication/category/product/ProductCategory.java +++ b/src/java/org/mxchange/pizzaapplication/category/product/ProductCategory.java @@ -29,7 +29,7 @@ public class ProductCategory extends BaseCategory { * @param title Category title * @param parent Parent id */ - public ProductCategory (final Integer id, final String title, final Integer parent) { + public ProductCategory (final Long id, final String title, final Long parent) { // Call parent constructor super(id, title, parent); } 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 30acafcd..b49ec8aa 100644 --- a/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java +++ b/src/java/org/mxchange/pizzaapplication/database/frontend/category/PizzaCategoryDatabaseFrontend.java @@ -187,9 +187,9 @@ public class PizzaCategoryDatabaseFrontend extends BaseDatabaseFrontend implemen // "Walk" through all entries while (resultSet.next()) { // Get id, title and parent id - Integer id = resultSet.getInt(PizzaCategoryDatabaseConstants.COLUMN_ID); + Long id = resultSet.getLong(PizzaCategoryDatabaseConstants.COLUMN_ID); String title = resultSet.getString(PizzaCategoryDatabaseConstants.COLUMN_TITLE); - Integer parent = resultSet.getInt(PizzaCategoryDatabaseConstants.COLUMN_PARENT); + Long parent = resultSet.getLong(PizzaCategoryDatabaseConstants.COLUMN_PARENT); // Debug message this.getLogger().debug(MessageFormat.format("id={0},title={1},parent={2}", id, title, parent));