Examples of Reservation


Examples of cz.muni.fi.pa165.library.backend.Reservation

      
    }
  
    public void testInsertCorrectReservation() { 
        em.getTransaction().begin();       
        Reservation reservation = new Reservation(em.find(Reader.class, new Long(1)),
                                   em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));     
        em.persist(reservation);
        em.getTransaction().commit();
      
        assertNotNull(reservationDAOImpl.findReservationByID(reservation.getReservationID()));
      
        if (em != null) {
            em.close();
        }       
    }
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

        }       
    }
  
    public void testFindAllReservations() {
        em.getTransaction().begin();       
        Reservation reservation1 = new Reservation(em.find(Reader.class, new Long(1)),
                                   em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));
        Reservation reservation2 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(9)), new Date(System.currentTimeMillis()));
        em.persist(reservation1);
        em.persist(reservation2);       
        em.getTransaction().commit();
      
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

    }
  
    public void testFindReservationByID() {     
        em.getTransaction().begin();
      
        Reservation reservation1 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));
        Reservation reservation2 = new Reservation(em.find(Reader.class, 1l),
                em.find(Book.class, new Long(9)), new Date(System.currentTimeMillis()));
        em.persist(reservation1);
        em.persist(reservation2);
      
        em.getTransaction().commit();
      
        reservation1.setReservationID(new Long(1));
        reservation2.setReservationID(new Long(2));
      
        assertEquals(reservation1, reservationDAOImpl.findReservationByID(new Long(1)));
        assertEquals(reservation2, reservationDAOImpl.findReservationByID(new Long(2)));
      
        if (em != null) {
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

    }
  
    public void testFindReservationsByReader() {     
        em.getTransaction().begin();
      
        Reservation reservation1 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));
        Reservation reservation2 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(9)), new Date(System.currentTimeMillis()));
        em.persist(reservation1);
        em.persist(reservation2);
      
        em.getTransaction().commit();
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

    }
  
    public void testFindReservationByBook() {     
        em.getTransaction().begin();
      
        Reservation reservation1 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));
        Reservation reservation2 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(9)), new Date(System.currentTimeMillis()));
        em.persist(reservation1);
        em.persist(reservation2);
      
        em.getTransaction().commit();
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

    }
  
    public void testDeleteReservation() {
        em.getTransaction().begin();
      
        Reservation reservation1 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(8)), new Date(System.currentTimeMillis()));
        Reservation reservation2 = new Reservation(em.find(Reader.class, new Long(1)),
                em.find(Book.class, new Long(9)), new Date(System.currentTimeMillis()));
        em.persist(reservation1);
        em.persist(reservation2);
      
        em.getTransaction().commit();
View Full Code Here

Examples of cz.muni.fi.pa165.library.backend.Reservation

  
    private void createReservationData() {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        entityManager.getTransaction().begin();
      
        entityManager.persist(new Reservation(
                entityManager.find(Reader.class, 1l),
                entityManager.find(Book.class, 8l),
                new Date(System.currentTimeMillis())));
        entityManager.persist(new Reservation(
                entityManager.find(Reader.class, 1l),
                entityManager.find(Book.class, 9l),
                new Date(System.currentTimeMillis())));
      
        entityManager.getTransaction().commit();
View Full Code Here

Examples of data.reservation.Reservation

     * Pour chaque reservation on enleve les Fauteuils occupes par celle-ci
     * dans la Zone resultat.
     */
    Collection lesReservations = fr.getLesReservations(idSeance, idZone);
    for(Iterator itRes = lesReservations.iterator(); itRes.hasNext();){
      Reservation r = (Reservation)itRes.next();
      Collection lesFauteuils = r.getLesFauteuils();
      System.out.println("INFO: Fauteuils de la reservation "+r.getIdReserv()+":\n"+lesFauteuils);
      for(Iterator itFauteuils = lesFauteuils.iterator();
        itFauteuils.hasNext();){
        Fauteuil f = (Fauteuil)itFauteuils.next();
        try{
          this.removePlace(z, f);
View Full Code Here

Examples of edu.brown.benchmark.seats.util.Reservation

        results[0].addRow(new Long(1));
        ClientResponseImpl cresponse = new ClientResponseImpl(TXN_ID, CLIENT_HANDLE,
                                                              0, Status.OK,
                                                              results, "");
       
        Reservation r = new Reservation(RESERVATION_ID, this.flight_id, customer_id, seatnum);
        assertNotNull(r);
        NewReservationCallback callback = this.client.new NewReservationCallback(r);
        callback.clientCallback(cresponse);
       
        // Check to make sure that our seat is now reserved
View Full Code Here

Examples of net.sf.czarrental.bl.reservation.Reservation

    return reservations;
  }

  @Override
  public Reservation readReservation(int id) {
    Reservation reservation = null;
    Transaction tx = null;
    try {
      Session session = SessionFactoryUtil.getInstance()
          .getCurrentSession();
      tx = session.beginTransaction();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.