1.1 --- a/src/main/java/de/uapcore/lightpit/dao/UserDao.java Fri Oct 09 19:06:51 2020 +0200 1.2 +++ b/src/main/java/de/uapcore/lightpit/dao/UserDao.java Fri Oct 09 19:07:05 2020 +0200 1.3 @@ -32,8 +32,19 @@ 1.4 1.5 import java.sql.SQLException; 1.6 import java.util.List; 1.7 +import java.util.Optional; 1.8 1.9 public interface UserDao extends GenericDao<User> { 1.10 1.11 List<User> list() throws SQLException; 1.12 + 1.13 + /** 1.14 + * Tries to find a user by their username. 1.15 + * The search is case-insensitive. 1.16 + * 1.17 + * @param username the username 1.18 + * @return the user object or an empty optional if no such user exists 1.19 + * @throws SQLException 1.20 + */ 1.21 + Optional<User> findByUsername(String username) throws SQLException; 1.22 }