From 2c199732fe6575edde119bab476fd75c6719b084 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 15 Apr 2016 14:23:41 +0200 Subject: [PATCH] added new business method findUserById() --- .../model/user/UserSessionBeanRemote.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java index 49ace59..de17843 100644 --- a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java +++ b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java @@ -21,6 +21,7 @@ import java.util.List; import javax.ejb.Remote; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; +import org.mxchange.jusercore.exceptions.UserNotFoundException; /** * An interface for user beans @@ -30,12 +31,25 @@ import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; @Remote public interface UserSessionBeanRemote extends Serializable { + /** + * Find user by given user id and returns fetched instance. If the user is + * not found, an exception is thrown. + *

+ * @param userId User id + *

+ * @return User instance + * + * @throws org.mxchange.jusercore.exceptions.UserNotFoundException If the user is not found + */ + User findUserById (final Long userId) throws UserNotFoundException; + /** * Adds given user to database, if not found by user name or email address. *

* @param user User instance to add *

* @return Updated user instance + *

* @throws org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException When the user name is already used * @throws org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException When the email address is already used */ -- 2.39.5