From b3da48b0ddca1b840aa67a5a07a39694afd79653 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 11 Apr 2016 19:57:05 +0200 Subject: [PATCH] addCountry() now must return the updated instance (with timestamp and valid countryId field) --- .../jcountry/data/AddressbookCountrySingletonBean.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java index fbcdb44..2da1508 100644 --- a/src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java @@ -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 -- 2.39.5