public Account getByUsername(String username) { return accountRepository.findOneByEmail(username); } public Account getFromPrincipal(Principal principal) { return getByUsername(principal.getName()); }