Duh! Manually supply ID to Dao in Entity class

My entity: @Entity(tableName = "accounts") data class Account( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "user_id") val id: Int, @ColumnInfo(name = "first_name") val firstName: String, @ColumnInfo(name = "last_name") val lastName: String?, @ColumnInfo(name = "email") val email: String ) I am doing this: fun register(email: String, name: String) { return dbRepository.createAccount(Account(firstName = name, email = email)) } Dao:… Read More Duh! Manually supply ID to Dao in Entity class

How to compare the hashed password with the one stored in the mySql database?

Inside a login Servlet, java, I hashed the password, entered as input by a user. Subsequently I have to compare the password entered as input and of which I obtained the hash, with the hash of the password stored on a MySql database. Below, there is the Servlet code and the doPost method, within which… Read More How to compare the hashed password with the one stored in the mySql database?