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 } |