optimized lazy read
This commit is contained in:
@ -134,7 +134,7 @@ public class AccountControl {
|
||||
if (account.getUsername().equals(currentUserName)) {
|
||||
throw new AccountException("Cannot delete own account");
|
||||
} else {
|
||||
account.setStatus(AccountStatus.DISABLED.name());
|
||||
account.setStatus(AccountStatus.DISABLED.name());
|
||||
account.setLastUpdatedBy(currentUserName);
|
||||
account.setLastUpdatedOn(now);
|
||||
em.merge(account);
|
||||
@ -164,7 +164,7 @@ public class AccountControl {
|
||||
account.setPasswordResetOngoing(true);
|
||||
account.setPasswordResetValidTo(validTo);
|
||||
|
||||
mailService.sendPasswortResetStartEmail(account,randomString);
|
||||
mailService.sendPasswortResetStartEmail(account, randomString);
|
||||
|
||||
em.merge(account);
|
||||
return true;
|
||||
@ -257,8 +257,8 @@ public class AccountControl {
|
||||
int maxFailedLogins = configService.getMaxFailedLogins();
|
||||
if ((account.getFailureCount() >= maxFailedLogins) && (!account.getStatus().equals("LOCKED"))) { // TOD add status enum
|
||||
// max failed logins reached, disabling user
|
||||
LOGGER.info( "Locking account " + account.getUsername() + " due to " + account.getFailureCount() + " failed logins");
|
||||
account.setStatus(AccountStatus.BLOCKED.name());
|
||||
LOGGER.info("Locking account " + account.getUsername() + " due to " + account.getFailureCount() + " failed logins");
|
||||
account.setStatus(AccountStatus.BLOCKED.name());
|
||||
}
|
||||
|
||||
// on a failed login request, disable password reset
|
||||
|
||||
@ -8,6 +8,7 @@ import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
@ -136,9 +137,9 @@ public class AccountEntity implements Serializable, Account {
|
||||
@JoinTable(name = "account_role", joinColumns = {
|
||||
@JoinColumn(name = "account", referencedColumnName = "id")}, inverseJoinColumns = {
|
||||
@JoinColumn(name = "account_role", referencedColumnName = "id")})
|
||||
@ManyToMany
|
||||
@ManyToMany(fetch = FetchType.LAZY)
|
||||
private List<ApplicationRoleEntity> applicationRoleList;
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "accountId")
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "accountId", fetch = FetchType.LAZY)
|
||||
private List<AccountHistoryEntity> accountHistoryList;
|
||||
|
||||
public AccountEntity() {
|
||||
|
||||
@ -7,7 +7,6 @@ import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@ -25,7 +25,8 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
@NamedQuery(name = "MailTemplateEntity.findByTemplateValue", query = "SELECT m FROM MailTemplateEntity m WHERE m.templateValue = :templateValue")})
|
||||
public class MailTemplateEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 4527399247302581555L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
|
||||
@ -49,9 +49,7 @@ public class LoginView implements Serializable {
|
||||
|
||||
// "Remember Me" built-in:
|
||||
token.setRememberMe(rememberMe);
|
||||
|
||||
Subject currentUser = SecurityUtils.getSubject();
|
||||
|
||||
LOGGER.info("Submitting login with username of " + username);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user