Examples of commitChangesToParent()


Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        Artist a = Cayenne.objectForPK(childContext, Artist.class, 33001);
        Painting p = childContext.newObject(Painting.class);
        p.setPaintingTitle("X");
        a.addToPaintingArray(p);

        childContext.commitChangesToParent();

        childContext.deleteObjects(p);
        a.removeFromPaintingArray(p);

        childContext.commitChangesToParent();
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        childContext.commitChangesToParent();

        childContext.deleteObjects(p);
        a.removeFromPaintingArray(p);

        childContext.commitChangesToParent();
    }

    /**
     * A test case for CAY-698 bug.
     */
 
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        childContext.invalidateObjects(childHollow);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                // * all modified child objects must be in committed state now
                // * all modifications should be propagated to the parent
                // * no actual commit should occur.

View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        childContext.deleteObjects(childDeleted);
        childDeleted.setArtistName("DDD");

        // don't block queries - on delete Cayenne may need to resolve delete rules via
        // fetch
        childContext.commitChangesToParent();

        // * all modified child objects must be in committed state now
        // * all modifications should be propagated to the parent
        // * no actual commit should occur.

View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

            public void execute() {
                Painting parentModifiedSimple = null;
                Artist parentModifiedToMany = null;

                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childModifiedSimple
                        .getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childModifiedToOne
                        .getPersistenceState());
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        childDetail1.setPainting(childMaster);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childMaster
                        .getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childDetail1
                        .getPersistenceState());
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        assertEquals(1, childO2.getArtistArray().size());

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childO1.getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childO2.getPersistenceState());

                Artist parentO1 = (Artist) context.getGraphManager().getNode(
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        final ArtGroup childO2 = childContext.newObject(ArtGroup.class);
        childO2.setName("o2");
        childO2.addToArtistArray(childO1);

        childContext.commitChangesToParent();

        final ArtGroup childO3 = childContext.newObject(ArtGroup.class);
        childO3.setName("o3");
        childO1.addToGroupArray(childO3);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        assertEquals(1, childO3.getArtistArray().size());

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childO1.getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childO2.getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childO3.getPersistenceState());
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.commitChangesToParent()

        childO1.removeFromGroupArray(childO2);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childO1.getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childO2.getPersistenceState());
                assertEquals(PersistenceState.COMMITTED, childO3.getPersistenceState());
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.