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=df07c71e6794f7c2f0679092247ce29edef1a17a;p=jjobs-ejb.git addCountry() now must return the updated instance (with timestamp and valid countryId field) --- diff --git a/src/java/org/mxchange/jcountry/data/JobsCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/JobsCountrySingletonBean.java index 0dfc857..7d05693 100644 --- a/src/java/org/mxchange/jcountry/data/JobsCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/data/JobsCountrySingletonBean.java @@ -41,7 +41,7 @@ public class JobsCountrySingletonBean extends BaseDatabaseBean implements Countr 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 JobsCountrySingletonBean extends BaseDatabaseBean implements Countr // Flush it to get id number back, maybe it is directly needed? this.getEntityManager().flush(); + + // Return updated instance + return country; } @Override