Examples of BidiChild


Examples of org.apache.openjpa.persistence.relations.BidiChild

    private long childId;

    public void setUp() {
        setUp(BidiParent.class, BidiChild.class, CLEAR_TABLES);

        BidiChild child = new BidiChild();
        child.setName("child");

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(child);
        em.getTransaction().commit();
        childId = child.getId();
        em.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.relations.BidiChild

        em.close();
    }

    public void testPersistWithManagedRelation() {
        BidiParent parent = new BidiParent();
        BidiChild child = em.find(BidiChild.class, childId);
        parent.setOneToOneChild(child);
        em.getTransaction().begin();
        em.persist(parent);
        em.getTransaction().commit();
        long id = parent.getId();
View Full Code Here

Examples of org.apache.openjpa.persistence.relations.BidiChild

        assertNotNull(parent);
    }

    public void testMergeWithManagedRelation() {
        BidiParent parent = new BidiParent();
        BidiChild child = em.find(BidiChild.class, childId);
        parent.setOneToOneChild(child);
        em.getTransaction().begin();
        parent = em.merge(parent);
        em.getTransaction().commit();
        long id = parent.getId();
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.