@Override public List<Games> list(String date) { Query query = entityManager.createQuery("SELECT d FROM Games d WHERE d.date LIKE :date", Games.class); query.setParameter("date", date); return (List<Games>) query.getResultList(); }
@Override public List<Games> list(AllField allField) { Query query = entityManager.createQuery( "SELECT g FROM Games g WHERE g.all_field LIKE :all_field", Games.class); query.setParameter("all_field", allField); return (List<Games>) query.getResultList(); }
@Override public List<Games> listAll() { // entityManager.refresh(); Query query = entityManager.createQuery("SELECT g FROM Games g", Games.class); return (List<Games>) query.getResultList(); }
@Override public Games get(long id) { return entityManager.find(Games.class, id); }
@Override public void delete(long id) { entityManager.getTransaction().begin(); entityManager.remove(get(id)); entityManager.getTransaction().commit(); }
@Override public void delete(Games games) { entityManager.remove(games); }
@Override public void add(Games games) { entityManager.merge(games); }