Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerSPI.persist()


            // expected
        }
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        em.getTransaction().begin();
        AllFieldTypes type = new AllFieldTypes();
        em.persist(type);
        em.getTransaction().commit();
        Object oid = em.getObjectId(type);
        assertEquals(Id.class, JPAFacadeHelper.toOpenJPAObjectId(cmd, oid).getClass());
    }
}
View Full Code Here


        Person e2 = new Person();
        e2.setId(2);
        e2.setPhoneNumbers(numbers);

        p.setOwners(Arrays.asList(new Person[] { e1, e2 }));
        em.persist(e1);
        em.persist(e2);
        em.persist(p);

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

        e2.setId(2);
        e2.setPhoneNumbers(numbers);

        p.setOwners(Arrays.asList(new Person[] { e1, e2 }));
        em.persist(e1);
        em.persist(e2);
        em.persist(p);

        em.getTransaction().commit();
        em.close();
    }
View Full Code Here

        e2.setPhoneNumbers(numbers);

        p.setOwners(Arrays.asList(new Person[] { e1, e2 }));
        em.persist(e1);
        em.persist(e2);
        em.persist(p);

        em.getTransaction().commit();
        em.close();
    }
}
View Full Code Here

        // Call base setter with property access
        Date now = new Date();
        fs.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(fs);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
View Full Code Here

        // Call base setter with property access
        Date now = new Date();
        fs.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(fs);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
View Full Code Here

        SuperPropertyEntity spe = new SuperPropertyEntity();
        spe.setName("SuperPropertyEntity");
       
        em.getTransaction().begin();
        em.persist(fs);
        em.persist(spe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
View Full Code Here

        SuperPropertyEntity spe = new SuperPropertyEntity();
        spe.setName("SuperPropertyEntity");
       
        em.getTransaction().begin();
        em.persist(fs);
        em.persist(spe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
View Full Code Here

        SuperFieldEntity sfe = new SuperFieldEntity();
        sfe.setName("SuperFieldEntity");
       
        em.getTransaction().begin();
        em.persist(ps);
        em.persist(sfe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
View Full Code Here

        SuperFieldEntity sfe = new SuperFieldEntity();
        sfe.setName("SuperFieldEntity");
       
        em.getTransaction().begin();
        em.persist(ps);
        em.persist(sfe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
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.