Examples of commitChanges()


Examples of org.apache.cayenne.access.DataContext.commitChanges()

        Object pk = a.getObjectId().getReplacementIdMap().get(Artist.ARTIST_ID_PK_COLUMN);
        assertNotNull(pk);

        assertEquals(pk, Cayenne.longPKForObject(a));

        context.commitChanges();

        Object pkAfterCommit = a.getObjectId().getIdSnapshot().get(
                Artist.ARTIST_ID_PK_COLUMN);
        assertEquals(pk, pkAfterCommit);
    }
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        final int nrows = 10;
        for (int i = 0; i < nrows; i++) {
            DataObject o = (DataObject) ctxt.newObject("Painting");
            o.writeProperty("paintingTitle", "ptitle" + i);
        }
        ctxt.commitChanges();

        // create and add new column to model and db
        DbAttribute column = new DbAttribute("NEWCOL2", Types.VARCHAR, dbEntity);

        column.setMandatory(false);
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        DataContext context = createDataContext();

        for (int i = 0; i < 5; i++) {
            Artist obj = context.newObject(Artist.class);
            obj.setArtistName("a" + i);
            context.commitChanges();
        }
    }

    private void insertPaintValue() {
        DataContext context = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

            Artist art = context.newObject(Artist.class);
            art.setArtistName("a" + i);
            Painting obj = context.newObject(Painting.class);
            obj.setToArtist(art);
            obj.setPaintingTitle("title" + i);
            context.commitChanges();
        }
    }

    public void testGetExpression() {
        String ejbql = "select a FROM Artist a";
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

            for (int i = 0; i < 5; i++) {
                CayenneDataObject dao = (CayenneDataObject) ctxt.newObject(objEntity
                        .getName());
                dao.writeProperty(oatr1.getName(), "test " + i);
            }
            ctxt.commitChanges();
        }
        finally {
            sourceMap.removeObjEntity(objEntity.getName(), true);
            sourceMap.removeDbEntity(dbEntity.getName(), true);
        }
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        // this should go away when such mapping becomes fully supported
        target.setDepId(new Integer(1));
        target.setRoot2(src2);

        src.addToDeps(target);
        context.commitChanges();

        context.invalidateObjects(Arrays.asList(src, target, src2));

        ToManyFkRoot src1 = (ToManyFkRoot) Cayenne.objectForPK(context, src
                .getObjectId());
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        a1.removeFromGroupArray(group); // Cause the delete of the link record

        context.deleteObject(a1); // Cause the deletion of the artist

        try {
            context.commitChanges();
        }
        catch (Exception e) {
            e.printStackTrace();
            fail("Should not have thrown the exception :" + e.getMessage());
        }
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        a1.addToGroupArray(group);
        group.removeFromArtistArray(a1);

        blockQueries();
        try {
            context.commitChanges();
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        // and then deleted AND there are some other changes (CAY-548)
        a1.removeFromGroupArray(g1);

        MockDataNode engine = MockDataNode.interceptNode(getDomain(), getNode());
        try {
            context.commitChanges();
            assertEquals(1, engine.getRunCount());
        }
        finally {
            engine.stopInterceptNode();
        }
View Full Code Here

Examples of org.apache.cayenne.access.DataContext.commitChanges()

        // *** TESTING THIS ***
        p1.setToArtist(a1);

        assertSame(a1, p1.getToArtist());

        context.commitChanges();
        ObjectId aid = a1.getObjectId();
        ObjectId pid = p1.getObjectId();
        context.invalidateObjects(Arrays.asList(a1, p1));

        Painting1 p2 = (Painting1) Cayenne.objectForPK(context, pid);
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.