]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 24 Mar 2018 22:20:53 +0000 (23:20 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 15 Jul 2019 05:17:03 +0000 (07:17 +0200)
- updated reference UserUtils to Users

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java
src/java/org/mxchange/pizzaapplication/enterprise/BasePizzaEnterpriseBean.java

index 54260d3e68796ec57e4f663773999d494a969c7b..bbd7735cb172b350c5369ea735b7058e2e624632 100644 (file)
@@ -221,7 +221,7 @@ public class PizzaUserSessionBean extends BasePizzaEnterpriseBean implements Use
                // Loop until a user name is found
                while ((userName == null) || (userList.contains(userName))) {
                        // Generate random name
-                       userName = UserUtils.generateRandomUserName();
+                       userName = Users.generateRandomUserName();
                }
 
                // Trace message
@@ -416,33 +416,33 @@ public class PizzaUserSessionBean extends BasePizzaEnterpriseBean implements Use
        }
 
        @Override
-       public User updateUserData (final User user) {
+       public User updateUserData (final User detachedUser) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: detachedUser={1} - CALLED!", this.getClass().getSimpleName(), detachedUser)); //NOI18N
 
                // user should not be null
-               if (null == user) {
+               if (null == detachedUser) {
                        // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
+                       throw new NullPointerException("detachedUser is null"); //NOI18N
+               } else if (detachedUser.getUserId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
+                       throw new NullPointerException("detachedUser.userId is null"); //NOI18N
+               } else if (detachedUser.getUserId() < 1) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
-               } else if (user.getUserAccountStatus() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("detachedUser.userId={0} is not valid", detachedUser.getUserId())); //NOI18N
+               } else if (detachedUser.getUserAccountStatus() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
-               } else if (!this.ifUserExists(user)) {
+                       throw new NullPointerException("detachedUser.userAccountStatus is null"); //NOI18N
+               } else if (!this.ifUserExists(detachedUser)) {
                        // User does not exist
-                       throw new EJBException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
+                       throw new EJBException(MessageFormat.format("User with id {0} does not exist.", detachedUser.getUserId())); //NOI18N
                }
 
                // Find the instance
-               final User foundUser = this.getEntityManager().find(user.getClass(), user.getUserId());
+               final User foundUser = this.getEntityManager().find(detachedUser.getClass(), detachedUser.getUserId());
 
                // Should be found!
-               assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N
+               assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", detachedUser.getUserId()); //NOI18N
 
                // Merge user
                final User managedUser = this.getEntityManager().merge(foundUser);
@@ -451,7 +451,7 @@ public class PizzaUserSessionBean extends BasePizzaEnterpriseBean implements Use
                assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", managedUser.getUserId()); //NOI18N
 
                // Copy all data
-               UserUtils.copyAll(user, managedUser);
+               Users.copyAll(detachedUser, managedUser);
 
                // Set as updated
                managedUser.setUserUpdated(new Date());
@@ -569,7 +569,7 @@ public class PizzaUserSessionBean extends BasePizzaEnterpriseBean implements Use
                assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N
 
                // Copy all data
-               UserUtils.copyAll(user, managedUser);
+               Users.copyAll(user, managedUser);
 
                // Set as updated
                managedUser.setUserUpdated(new Date());
index aa0472fab851003c92966e267798a58334e61ada..057ec07309ed1df7356e52e20a30c20ed5916c23 100644 (file)
@@ -52,7 +52,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
 import org.mxchange.jphone.utils.PhoneUtils;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserUtils;
+import org.mxchange.jusercore.model.user.Users;
 
 /**
  * A helper class for beans that access the database.
@@ -1168,7 +1168,7 @@ public abstract class BasePizzaEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Set all values
-               final Properties variables = UserUtils.getAllUserFields(user);
+               final Properties variables = Users.getAllUserFields(user);
 
                // Set base URL and random password
                variables.put("baseUrl", baseUrl); //NOI18N