java.lang.Object
com.example.project.services.sqlite.dAOs.UsersDAO
SQLite Users database. with a table `users` 2 columns. 'username', 'password'. Which are both defined as unique
not null Strings in sqlite.
-
Constructor Summary
ConstructorsConstructorDescriptionUsersDAO()
Constructor for this class SQLLiteDictionary.UsersDAO
(Connection connection, Logger logger) Constructor with injection for unit tests. -
Method Summary
-
Constructor Details
-
UsersDAO
public UsersDAO()Constructor for this class SQLLiteDictionary. -
UsersDAO
Constructor with injection for unit tests.- Parameters:
connection
- Connectionlogger
- logger.
-
-
Method Details
-
addUser
Adds user to the user.db. password will be hashed before storing to ensure greater security (no plain text passwords)- Parameters:
user
- user to add.
-
doesUserExist
- Parameters:
username
- username- Returns:
- returns bool indicating whether use is in database already.
-
getUser
- Parameters:
username
- username.- Returns:
- returns user with matching username.
-