Package de.mhus.lib.jpa

Examples of de.mhus.lib.jpa.JpaEntityManager.createQuery()


    assertTrue(book1 != copyBook1);
   
    // assertTrue(foundBook.is)
   
    {
      JpaQuery<Book> query = em.createQuery("select b from Book b", Book.class);
     
 
      List<Book> list = query.getResultList();
     
      assertTrue(list.size() == 2);
View Full Code Here


    p2.save();
   
    em.commit();
   
    {
      JpaQuery<Person> query = em.createQuery("select p from Person p", Person.class);
      List<Person> list = query.getResultList();
      assertTrue(list.size() == 2);
     
      for ( Person res : list) {
        System.out.println("RES: " + res.getId() + " " + res.getName());
View Full Code Here

    em.begin();
    p2.remove();
    em.commit();
   
    {
      JpaQuery<Person> query = em.createQuery("select p from Person p", Person.class);
      List<Person> list = query.getResultList();
      assertTrue(list.size() == 1);
     
      for ( Person res : list) {
        System.out.println("RES: " + res.getId() + " " + res.getName());
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.