@Repository @Transactional public class CredentialsRepositoryJDBC extends Object implements CredentialsRepository
CredentialsRepository interface.
All methods run within transactions.
| Constructor and Description |
|---|
CredentialsRepositoryJDBC() |
| Modifier and Type | Method and Description |
|---|---|
void |
changeEmail(User user,
String newEmail)
Change existing user's email address.
|
void |
changePassword(User user,
String newPassword)
Change existing user's password with the new one.
|
User |
getCredentials(String email)
Find user by email address and return all details, including password.
|
public User getCredentials(String email)
CredentialsRepositorygetCredentials in interface CredentialsRepositoryemail - User's identifier, unique email addresspublic void changePassword(User user, String newPassword)
CredentialsRepositoryThis method won't generate new password in case if given is null or empty - the exception will be thrown instead.
changePassword in interface CredentialsRepositoryuser - User with existing passwordnewPassword - A new password to be setpublic void changeEmail(User user, String newEmail)
CredentialsRepositorychangeEmail in interface CredentialsRepositoryuser - Existing usernewEmail - New email address