From cc026066cd4ca97e115290e368610132eaf52f7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 27 Apr 2016 15:03:04 +0200 Subject: [PATCH] Always remove contact instance from admin helper bean after linking it to avoid confusion --- .../beans/customer/PizzaAdminCustomerWebRequestBean.java | 3 +++ .../beans/user/PizzaAdminUserWebRequestBean.java | 3 +++ 2 files changed, 6 insertions(+) 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); -- 2.39.5