From aae3701b3bf5a67a88341b06635b7959f26ff303 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) --- .../mxchange/jcountry/data/PizzaCountrySingletonBean.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.2