Package org.apache.openjpa.persistence

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


        startTx(pm);
        LocatorTestObject o = new LocatorTestObject();
        byte[] bytes = new byte[size];
        Arrays.fill(bytes, (byte) 'b');
        o.setBytes(bytes);
        pm.persist(o);
        Object oid = pm.getObjectId(o);
        endTx(pm);
        pm.close();

        pm = (OpenJPAEntityManager)currentEntityManager();
View Full Code Here


        startTx(pm);
        LocatorTestObject o = new LocatorTestObject();
        byte[] bytes = new byte[50000];
        Arrays.fill(bytes, (byte) 'b');
        o.setBytes(bytes);
        pm.persist(o);
        Object oid = pm.getObjectId(o);
        endTx(pm);
        pm.close();

        pm = (OpenJPAEntityManager)currentEntityManager();
View Full Code Here

        startTx(pm);
        LocatorTestObject o = new LocatorTestObject();
        char[] chars = new char[size];
        Arrays.fill(chars, (char) 'c');
        o.setClobString(new String(chars));
        pm.persist(o);
        Object oid = pm.getObjectId(o);
        endTx(pm);
        pm.close();

        pm = (OpenJPAEntityManager)currentEntityManager();
View Full Code Here

        startTx(pm);
        LocatorTestObject o = new LocatorTestObject();
        char[] chars = new char[50000];
        Arrays.fill(chars, (char) 'c');
        o.setClobString(new String(chars));
        pm.persist(o);
        Object oid = pm.getObjectId(o);
        endTx(pm);
        pm.close();

        pm = (OpenJPAEntityManager)currentEntityManager();
View Full Code Here

        pc.setIntField1(100);

        RuntimeTest1 npc = new RuntimeTest1();
        npc.setIntField(2);
        npc.setIntField1(2);
        pm.persist(npc);
        pm.validateChanges();

        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));
View Full Code Here

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);

        RuntimeTest1 npc = new RuntimeTest1();
        pm.persist(npc);
        Object noid = pm.getObjectId(npc);

        pm.validateChanges();
        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));
View Full Code Here

        pc.setIntField1(100);

        RuntimeTest1 npc = new RuntimeTest1();
        npc.setIntField(2);
        npc.setIntField1(2);
        pm.persist(npc);

        pm.validateChanges();
        if (!hasConn)
            assertFalse(hasConnection(pm));
View Full Code Here

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);

        RuntimeTest1 npc = new RuntimeTest1();
        pm.persist(npc);
        Object noid = pm.getObjectId(npc);

        pm.validateChanges();
        if (!hasConn)
            assertFalse(hasConnection(pm));
View Full Code Here

    public void testSimple() {
        // test create
        {
            OpenJPAEntityManager pm = getPM();
            startTx(pm);
            pm.persist(new RuntimeTest1("testSimple", 12));
            endTx(pm);
            endEm(pm);
        }

        // test Query
View Full Code Here

        deleteAll();

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        AttachB b = new AttachB();
        pm.persist(b);
        b.setAint(5);
        b.setBstr("5");
        b.getStringIntMap().put("5", new Integer(5));

        AttachE e = new AttachE();
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.