import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
/**
- * A singleton bean for country informations
+ * A singleton EJB for country informations
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
@Startup
-@Singleton (name = "country", mappedName = "ejb/addressbook-singleton-country", description = "A singleton session bean for country informations")
+@Singleton (name = "country", description = "A singleton session bean for country informations")
public class AddressbookCountrySingletonBean extends BaseDatabaseBean implements CountrySingletonBeanRemote {
/**
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
// Flush it to get id number back, maybe it is directly needed?
this.getEntityManager().flush();
+
+ // Return updated instance
+ return country;
}
@Override