src/main/java/de/uapcore/lightpit/dao/UserDao.java

changeset 33
fd8c40ff78c3
parent 30
fb30f7b78f9b
child 34
824d4042c857
--- a/src/main/java/de/uapcore/lightpit/dao/UserDao.java	Sat May 09 14:58:41 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/dao/UserDao.java	Sat May 09 15:19:21 2020 +0200
@@ -36,7 +36,6 @@
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Optional;
 
 public class UserDao {
 
@@ -45,23 +44,23 @@
      *
      * @param result the database result set
      * @param user   the POJO
-     * @throws SQLException
+     * @throws SQLException on any kind of SQL errors
      */
     protected void mapColumns(ResultSet result, User user) throws SQLException {
         user.setUserID(result.getInt("userid"));
         user.setUsername(result.getString("username"));
-        user.setGivenname(Optional.ofNullable(result.getString("givenname")));
-        user.setLastname(Optional.ofNullable(result.getString("lastname"))); 
+        user.setGivenname(result.getString("givenname"));
+        user.setLastname(result.getString("lastname"));
     }
 
     /**
      * Returns a list of all users ordered by their username.
-     * 
+     * <p>
      * Does not return reserved system users with negative user IDs.
-     * 
+     *
      * @param conn the connection to use
      * @return a list of all users
-     * @throws SQLException 
+     * @throws SQLException on any kind of SQL errors
      */
     public List<User> listAll(Connection conn) throws SQLException {
         List<User> list = new ArrayList<>();

mercurial