From: Roland Haeder Date: Mon, 11 Apr 2016 17:57:05 +0000 (+0200) Subject: addCountry() now must return the updated instance (with timestamp and valid countryId... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aae3701b3bf5a67a88341b06635b7959f26ff303;p=pizzaservice-ejb.git addCountry() now must return the updated instance (with timestamp and valid countryId field) --- diff --git a/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java index 5600e4e..7575e65 100644 --- a/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java @@ -41,7 +41,7 @@ public class PizzaCountrySingletonBean extends BaseDatabaseBean implements Count private static final long serialVersionUID = 15_846_983_298_691_207L; @Override - public void addCountry (final Country country) throws CountryAlreadyAddedException { + public Country addCountry (final Country country) throws CountryAlreadyAddedException { // Is it already there? if (null == country) { // Throw NPE @@ -68,6 +68,9 @@ public class PizzaCountrySingletonBean extends BaseDatabaseBean implements Count // Flush it to get id number back, maybe it is directly needed? this.getEntityManager().flush(); + + // Return updated instance + return country; } @Override