@Test public void canFindAllAccounts() { List<Account> all = accountDAO.findAll(); assertThat(all).hasSize(1); }
public List<Account> findAll() { return getEntityManager() .createNamedQuery(Account.QUERY_ALL_ACCOUNTS, Account.class) .getResultList(); }
AccountDAO extends AbstractDAO<Account> { public List<Account> findAll() { return getEntityManager() .createNamedQuery(Account.QUERY_ALL_ACCOUNTS, Account.class) .getResultList(); } }
AccountDAO extends AbstractDAO<Account> { public List<Account> findAll() { return getEntityManager() .createNamedQuery(Account.QUERY_ALL_ACCOUNTS, Account.class) .getResultList(); } @SuppressWarnings("unused")  AccountDAO(); @VisibleForTesting  AccountDAO(EntityManager entityManager); }
AccountDAO extends AbstractDAO<Account> { public List<Account> findAll() { return getEntityManager() .createNamedQuery(Account.QUERY_ALL_ACCOUNTS, Account.class) .getResultList(); } @SuppressWarnings("unused")  AccountDAO(); @VisibleForTesting  AccountDAO(EntityManager entityManager); Optional<Account> findAccountByUsername(String username); List<Account> findAll(); List<Account> findAllEnabled(); Optional<Account> findAccountByEmail(@Nonnull String email); }
AccountDAO extends AbstractDAO<Account> { public List<Account> findAll() { return getEntityManager() .createNamedQuery(Account.QUERY_ALL_ACCOUNTS, Account.class) .getResultList(); } @SuppressWarnings("unused")  AccountDAO(); @VisibleForTesting  AccountDAO(EntityManager entityManager); Optional<Account> findAccountByUsername(String username); List<Account> findAll(); List<Account> findAllEnabled(); Optional<Account> findAccountByEmail(@Nonnull String email);  }