1 package dst.ass1.jpa.dao.impl;
3 import javax.persistence.EntityManager;
6 public class GenericDAO<TImpl extends T, T> implements dst.ass1.jpa.dao.GenericDAO<T> {
7 protected final EntityManager em;
8 private final Class<TImpl> c;
10 protected GenericDAO(EntityManager em, Class<TImpl> c) {
16 public T findById(Long id) {
17 return em.find(c, id);
21 public List<T> findAll() {
22 return em.createQuery("from " + c.getName()).getResultList();