Esempio n. 1
0
  @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();
  }
Esempio n. 2
0
  @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();
  }
Esempio n. 3
0
 @Override
 public List<Games> listAll() {
   //        entityManager.refresh();
   Query query = entityManager.createQuery("SELECT g FROM Games g", Games.class);
   return (List<Games>) query.getResultList();
 }
Esempio n. 4
0
 @Override
 public Games get(long id) {
   return entityManager.find(Games.class, id);
 }
Esempio n. 5
0
 @Override
 public void delete(long id) {
   entityManager.getTransaction().begin();
   entityManager.remove(get(id));
   entityManager.getTransaction().commit();
 }
Esempio n. 6
0
 @Override
 public void delete(Games games) {
   entityManager.remove(games);
 }
Esempio n. 7
0
  @Override
  public void add(Games games) {

    entityManager.merge(games);
  }