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

changeset 124
ed2e7aef2a3e
parent 62
833e0385572a
child 128
947d0f6a6a83
equal deleted inserted replaced
123:c27eee1259bd 124:ed2e7aef2a3e
30 30
31 import de.uapcore.lightpit.entities.User; 31 import de.uapcore.lightpit.entities.User;
32 32
33 import java.sql.SQLException; 33 import java.sql.SQLException;
34 import java.util.List; 34 import java.util.List;
35 import java.util.Optional;
35 36
36 public interface UserDao extends GenericDao<User> { 37 public interface UserDao extends GenericDao<User> {
37 38
38 List<User> list() throws SQLException; 39 List<User> list() throws SQLException;
40
41 /**
42 * Tries to find a user by their username.
43 * The search is case-insensitive.
44 *
45 * @param username the username
46 * @return the user object or an empty optional if no such user exists
47 * @throws SQLException
48 */
49 Optional<User> findByUsername(String username) throws SQLException;
39 } 50 }

mercurial