Examples of commitChangesToParent()


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

        a.removeFromPaintingArray(p2);

        // this causes an error on commit
        child.deleteObjects(p2);

        child.commitChangesToParent();

    }

    public void testCAY1194() throws Exception {
        DataContext context = createDataContext();
View Full Code Here

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

        assertEquals(0, artist.getPaintingArray().size());
        assertEquals(1, localParentMt.getPaintingArray().size());
        assertEquals(localParentMt.getPaintingArray().get(0).getObjectContext(), child);

        child.commitChangesToParent();
        assertEquals(1, artist.getPaintingArray().size());
        assertEquals(artist.getPaintingArray().get(0).getObjectContext(), context);

    }
}
View Full Code Here

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

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

        childContext.commitChangesToParent();

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

        childContext.commitChangesToParent();
View Full Code Here

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

        childContext.commitChangesToParent();

        childContext.deleteObject(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(Collections.singleton(childHollow));

        blockQueries();

        try {
            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.deleteObject(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()

        Painting parentModifiedSimple = null;
        Artist parentModifiedToMany = null;
        try {

            childContext.commitChangesToParent();

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

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

        PaintingInfo childDetail1 = childContext.newObject(PaintingInfo.class);
        childDetail1.setTextReview("Detail1");
        childDetail1.setPainting(childMaster);

        try {
            childContext.commitChangesToParent();

            assertEquals(PersistenceState.COMMITTED, childMaster.getPersistenceState());
            assertEquals(PersistenceState.COMMITTED, childDetail1.getPersistenceState());

            Painting parentMaster = (Painting) context.getGraphManager().getNode(
View Full Code Here

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

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

        try {
            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()

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

        childContext.commitChangesToParent();

        ArtGroup childO3 = childContext.newObject(ArtGroup.class);
        childO3.setName("o3");
        childO1.addToGroupArray(childO3);
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.