@Override
    public <T extends PersistentObject> Collection<T> list(Class<T> entityClass) {
        CriteriaBuilder qb = em.getCriteriaBuilder();
        CriteriaQuery<T> recordsQuery = qb.createQuery(entityClass);
        Root<T> root = recordsQuery.from(entityClass);
        recordsQuery.select(root);
        TypedQuery<T> query = em.createQuery(recordsQuery);
        return query.getResultList();
    }