Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI.createEntityManager()


        types.add(Uni_1ToM_Map_RelKey_FK.class);
        types.add(EntityC.class);
        types.add(EntityC_B1M_Map_RelKey_JT.class);
        types.add(Bi_1ToM_Map_RelKey_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here


    public void testUniManyToOneUsingJoinTable() {
        List<Class<?>> types = new ArrayList<Class<?>>();
        types.add(EntityC.class);
        types.add(Uni_MTo1_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

        types.add(EntityC_B11JT.class);
        types.add(EntityC_U11JT.class);
        types.add(Bi_1To1_JT.class);
        types.add(Uni_1To1_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

        types.add(EntityB.class);
        types.add(MappedSuper.class);
        OpenJPAEntityManagerFactorySPI oemf = createEMF2_0(types);
        EntityManager em = null;
        try {
            em = oemf.createEntityManager();
            EntityA a = new EntityA();
            a.setId(1);
            EntityB b = new EntityB();
            b.setId(1);
            a.setEntityB(b);
View Full Code Here

        types.add(Bi_1ToM_FK.class);
        types.add(Bi_1ToM_JT.class);
        types.add(Uni_1ToM_FK.class);
        types.add(Uni_1ToM_JT.class);
        OpenJPAEntityManagerFactorySPI oemf = createEMF2_0(types);
        EntityManager em = oemf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

        types.add(Uni_1ToM_Map_RelKey_FK.class);
        types.add(EntityC.class);
        types.add(EntityC_B1M_Map_RelKey_JT.class);
        types.add(Bi_1ToM_Map_RelKey_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

    public void testUniManyToOneUsingJoinTable() {
        List<Class<?>> types = new ArrayList<Class<?>>();
        types.add(EntityC.class);
        types.add(Uni_MTo1_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

        types.add(EntityC_B11JT.class);
        types.add(EntityC_U11JT.class);
        types.add(Bi_1To1_JT.class);
        types.add(Uni_1To1_JT.class);
        OpenJPAEntityManagerFactorySPI emf = createEMF2_0(types);
        EntityManager em = emf.createEntityManager();
       
        try {
            // trigger table creation
            em.getTransaction().begin();
            em.getTransaction().commit();
View Full Code Here

    /**
     * Create sequence so that the test does not require manual intervention in database.
     */
    private void createSequence(String sequence) {
        OpenJPAEntityManagerFactorySPI factorySPI = createEMF();
        OpenJPAEntityManagerSPI em = factorySPI.createEntityManager();

        try {
            em.getTransaction().begin();
            Query q = em.createNativeQuery("CREATE SEQUENCE " + sequence + " START WITH 1");
            q.executeUpdate();
View Full Code Here

        OpenJPAEntityManagerFactorySPI emf =
            createEMF(ResWordEntity.class,
            "openjpa.jdbc.SynchronizeMappings","buildSchema(ForeignKeys=true)",
            "openjpa.jdbc.SchemaFactory","native(ForeignKeys=true)");

        EntityManager em = emf.createEntityManager();
        ResWordEntity pe = new ResWordEntity();

        pe.setId(new Random().nextInt());
        pe.setAlias("AliasVal");
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.