]> git.mxchange.org Git - pizzaservice-mailer-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:19 +0000 (19:57 +0200)
src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java

index fbcdb44c42b7895b7bbd6550dd439f0faef3dae2..2da150843d11c601850e88b7fa8ca6a4460cfebb 100644 (file)
@@ -41,7 +41,7 @@ public class AddressbookCountrySingletonBean extends BaseDatabaseBean implements
        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 AddressbookCountrySingletonBean extends BaseDatabaseBean implements
 
                // Flush it to get id number back, maybe it is directly needed?
                this.getEntityManager().flush();
+
+               // Return updated instance
+               return country;
        }
 
        @Override