Examples of Borrow


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

        borrowList1.add(book2);
      
        List<Book> borrowAnotherBooks = new ArrayList<Book>();
        borrowAnotherBooks.add(book3);
      
        Borrow borrow = new Borrow(entityManager.find(Reader.class, 1l),borrowList1,
                new Date(System.currentTimeMillis()), new Date(System.currentTimeMillis()));
        entityManager.close();
       
        entityManager = entityManagerFactory.createEntityManager();
        entityManager.getTransaction().begin();
        entityManager.persist(borrow);
        entityManager.getTransaction().commit();
        borrow.getTitles().get(0).getId();
        entityManager.close();
      
        em.getTransaction().begin();
        borrowDAO.borrowBooks(borrow, borrowAnotherBooks);
        em.getTransaction().commit();
View Full Code Here

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

      
        Date firstTime = new Date(System.currentTimeMillis());
        Date afterMonth = new Date(firstTime.getTime() + 2592000000l);
      
        // ID 1
        Borrow borrow1 = new Borrow(entityManager.find(Reader.class, 1l), borrowList1, firstTime, firstTime);
        entityManager.close();

        try {
            borrowDAO.borrowBooks(borrow1, null);
            fail("Borrow list cannot be null");
View Full Code Here

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

        borrowAnotherBooks.add(book4);
        borrowAnotherBooks.add(book5);
        borrowAnotherBooks.add(book6);
        borrowAnotherBooks.add(book7);
      
        Borrow borrow = new Borrow(entityManager.find(Reader.class, 1l),borrowList1,
                new Date(System.currentTimeMillis()), new Date(System.currentTimeMillis()));
      
        entityManager.getTransaction().begin();
        entityManager.persist(borrow);
        entityManager.getTransaction().commit();
        borrow.getTitles().get(0).getId();
        entityManager.close();
      
        try {
            borrowDAO.borrowBooks(borrow, borrowAnotherBooks);
            fail("Cannot borrow more books than allowed count");
View Full Code Here

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

        Book book2 = entityManager.find(Book.class, 2l);
      
        List<Book> borrowList1 = new ArrayList<Book>();
        borrowList1.add(book1);
        borrowList1.add(book2);
        Borrow borrow = new Borrow(entityManager.find(Reader.class, 1l),borrowList1,
                new Date(System.currentTimeMillis()), new Date(System.currentTimeMillis() + 3432423423l));
        entityManager.close();
       
        entityManager = entityManagerFactory.createEntityManager();
        entityManager.getTransaction().begin();
        entityManager.persist(borrow);
        entityManager.getTransaction().commit();
        borrow.getTitles().get(0).getId();
        entityManager.close();
      
        entityManager = entityManagerFactory.createEntityManager();
        em.getTransaction().begin();
        borrowDAO.deleteBorrow(borrowDAO.findBorrowById(new Long(1)));
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.