Package org.apache.openjpa.persistence.query

Examples of org.apache.openjpa.persistence.query.Publisher


            c1.setD(d1);
            d1.setC(c1);
        }

        Publisher p1 = new Publisher();
        p1.setName("publisher1");
        em.persist(p1);

        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p1);
            magazine.setName("magagine"+i+"_"+p1.getName());
            em.persist(magazine);
        }

        Publisher p2 = new Publisher();
        p2.setName("publisher2");
        em.persist(p2);

        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p2);
            magazine.setName("magagine"+i+"_"+p2.getName());
            em.persist(magazine);
        }
       
        PPerson person;
        PPhone phone;
View Full Code Here


        assertEquals(2, sql.size());

        sql.clear();
        em.clear();
        for (int i = 0; i < list.size(); i++) {
            Publisher p = (Publisher) list.get(i);
            Set<Magazine> magazines = p.getMagazineCollection();
            assertEquals(4, magazines.size());
            for (Iterator iter = magazines.iterator(); iter.hasNext();) {
                Magazine m = (Magazine) iter.next();
                Publisher mp = m.getIdPublisher();
                assertEquals(p, mp);
            }
        }

        assertEquals(0, sql.size());
View Full Code Here

            c1.setD(d1);
            d1.setC(c1);
        }

        Publisher p1 = new Publisher();
        p1.setName("publisher1");
        em.persist(p1);
  
        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p1);
            magazine.setName("magagine"+i+"_"+p1.getName());
            em.persist(magazine);
        }

        Publisher p2 = new Publisher();
        p2.setName("publisher2");
        em.persist(p2);
  
        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p2);
            magazine.setName("magagine"+i+"_"+p2.getName());
            em.persist(magazine);
        }

        em.flush();
        em.getTransaction().commit();
View Full Code Here

        assertEquals(2, sql.size());

        sql.clear();
        em.clear();
        for (int i = 0; i < list.size(); i++) {
            Publisher p = (Publisher) list.get(i);
            Set<Magazine> magazines = p.getMagazineCollection();
            assertEquals(4, magazines.size());
            for (Iterator iter = magazines.iterator(); iter.hasNext();) {
                Magazine m = (Magazine) iter.next();
                Publisher mp = m.getIdPublisher();
                assertEquals(p, mp);
            }
        }

        assertEquals(0, sql.size());
View Full Code Here

            c1.setD(d1);
            d1.setC(c1);
        }

        Publisher p1 = new Publisher();
        p1.setName("publisher1");
        em.persist(p1);

        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p1);
            magazine.setName("magagine"+i+"_"+p1.getName());
            em.persist(magazine);
        }

        Publisher p2 = new Publisher();
        p2.setName("publisher2");
        em.persist(p2);

        for (int i = 0; i < 4; i++) {
            Magazine magazine = new Magazine();
            magazine.setIdPublisher(p2);
            magazine.setName("magagine"+i+"_"+p2.getName());
            em.persist(magazine);
        }

        em.flush();
        em.getTransaction().commit();
View Full Code Here

        assertEquals(2, sql.size());

        sql.clear();
        em.clear();
        for (int i = 0; i < list.size(); i++) {
            Publisher p = (Publisher) list.get(i);
            Set<Magazine> magazines = p.getMagazineCollection();
            assertEquals(4, magazines.size());
            for (Iterator iter = magazines.iterator(); iter.hasNext();) {
                Magazine m = (Magazine) iter.next();
                Publisher mp = m.getIdPublisher();
                assertEquals(p, mp);
            }
        }

        assertEquals(0, sql.size());
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.query.Publisher

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.