Package net.lr.tutorial.karaf.db.examplejpa.impl

Examples of net.lr.tutorial.karaf.db.examplejpa.impl.PersonServiceImpl.deleteAll()


        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
        personService.deleteAll();
        personService.add(new Person("Christian Schneider", "@schneider_chris"));
        em.getTransaction().commit();
        List<Person> persons = personService.getAll();
        Assert.assertEquals(1, persons.size());
        Assert.assertEquals("Christian Schneider", persons.get(0).getName());
View Full Code Here


        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
        personService.deleteAll();
        personService.add(new Person("Christian Schneider", "@schneider_chris"));
        em.getTransaction().commit();
        List<Person> persons = personService.getAll();
        Assert.assertEquals(1, persons.size());
        Assert.assertEquals("Christian Schneider", persons.get(0).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.