From: Roland Häder Date: Wed, 27 Apr 2016 13:03:04 +0000 (+0200) Subject: Always remove contact instance from admin helper bean after linking it to avoid confusion X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc026066cd4ca97e115290e368610132eaf52f7b;p=pizzaservice-war.git Always remove contact instance from admin helper bean after linking it to avoid confusion --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java index c5f937f5..9e5a4462 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java @@ -133,6 +133,9 @@ public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRe if (this.adminHelper.getContact() instanceof Contact) { // Link customer updatedCustomer = this.adminCustomerBean.linkCustomer(customer); + + // Remove contact instance + this.adminHelper.setContact(null); } else { // Add new customer instance updatedCustomer = this.adminCustomerBean.addCustomer(customer); diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java index c92a4cc9..e1d40d32 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java @@ -233,6 +233,9 @@ public class PizzaAdminUserWebRequestBean implements PizzaAdminUserWebRequestCon if (this.adminHelper.getContact() instanceof Contact) { // Link contact with this user updatedUser = this.userBean.linkUser(user); + + // Remove contact instance + this.adminHelper.setContact(null); } else { // Add new contact updatedUser = this.userBean.addUser(user);