}
@AssertTrue(message = "username is already being used by another user")
public boolean isUniqueLoginNameConstraint() {
IUserDAO userDAO = Registry.getUserDAO();
if (isNewObject()) {
return !userDAO.existsByLoginNameAnotherTransaction(loginName);
} else {
try {
User u = userDAO.findByLoginNameAnotherTransaction(loginName);
return u.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
}