]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
addCountry() now must return the updated instance (with timestamp and valid countryId...
authorRoland Haeder <roland@mxchange.org>
Mon, 11 Apr 2016 17:57:05 +0000 (19:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 11 Apr 2016 17:57:05 +0000 (19:57 +0200)
src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java

index 5600e4ea8765455e3eaa0837ba1c4ec78d17d9a2..7575e658b30da978051fcc3d3728ee7721934b84 100644 (file)
@@ -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