Package org.jrest.dao.test.entities

Examples of org.jrest.dao.test.entities.Book


    context.addModuleProvider(new DaoModuleProvider("org.jrest4guice.dao.test.jpa", "org.jrest4guice.dao.jpa"),
            new JpaGuiceModuleProvider()).init();
    BookDao dao = context.getBean(BookDao.class);
    Assert.assertNotNull(dao);
   
    Book b1 = getNewBook("Book 1", 10f, 10);
    Book b2 = getNewBook("Book 2", 10f, 10);
    dao.create(b1, b2);
    Assert.assertNotNull(b1.getId());
    Assert.assertNotNull(b2.getId());
   
    dao.delete(b1, b2);
    b1 = dao.load(b1.getId());
    b2 = dao.load(b2.getId());
    Assert.assertNull(b1);
    Assert.assertNull(b2);
  }
View Full Code Here


  private Book getNewBook(String title, float price, int length) {
    PackingInfo info = new PackingInfo("平装", "铜版纸", length);
    List<Author> authors = new ArrayList<Author>();
    authors.add(new Author("gzYangfan"));
   
    Book book = new Book();
    book.setTitle(title);
    book.setSummary("java");
    book.setPrice(price);
    book.setPackingInfo(info);
    book.setAuthors(authors);
   
    return book;
  }
View Full Code Here

TOP

Related Classes of org.jrest.dao.test.entities.Book

Copyright © 2018 www.massapicom. 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.