Package org.apache.cayenne.access

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


                refetch);
        assertEquals(object.getObjectId(), refreshedObject.getObjectId());

        object.setKey2(key2v2);

        context.commitChanges();
        assertEquals(key1v1, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY1_PK_COLUMN));
        assertEquals(key2v2, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY2_PK_COLUMN));
View Full Code Here


                refetch1);
        assertEquals(object.getObjectId(), refreshedObject.getObjectId());

        object.setKey2(key2v3);

        context.commitChanges();
        assertEquals(key1v1, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY1_PK_COLUMN));
        assertEquals(key2v3, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY2_PK_COLUMN));
View Full Code Here

        object.setKey1(key1v1);
        object.setKey2(key2v1);
        object.setName("testing testing");

        context.commitChanges();
        assertEquals(key1v1, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY1_PK_COLUMN));
        assertEquals(key2v1, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY2_PK_COLUMN));
View Full Code Here

        assertEquals(object.getObjectId(), refreshedObject.getObjectId());

        object.setKey1(key1v2);
        object.setKey2(key2v2);

        context.commitChanges();
        assertEquals(key1v2, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY1_PK_COLUMN));
        assertEquals(key2v2, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY2_PK_COLUMN));
View Full Code Here

        assertEquals(object.getObjectId(), refreshedObject.getObjectId());

        object.setKey1(key1v3);
        object.setKey2(key2v3);

        context.commitChanges();
        assertEquals(key1v3, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY1_PK_COLUMN));
        assertEquals(key2v3, object.getObjectId().getIdSnapshot().get(
                CompoundPkTestEntity.KEY2_PK_COLUMN));
View Full Code Here

        // Per CAY-1379 removing user and then refetching resulted in a FFE downstream
        group1.removeFromGroupMembers(user);
        Expression exp = ExpressionFactory.matchExp(Role.ROLE_GROUPS_PROPERTY, group2);
        SelectQuery query = new SelectQuery(Group.class, exp);
        context.performQuery(query);
        context.commitChanges();

        context.deleteObject(group1);
        context.deleteObject(group2);
        context.deleteObject(user);
        context.commitChanges();
View Full Code Here

        context.commitChanges();

        context.deleteObject(group1);
        context.deleteObject(group2);
        context.deleteObject(user);
        context.commitChanges();
    }
}
View Full Code Here

            p.setPaintingDescription("Painting desc #" + i);
            PaintingInfo pi = ctxt.newObject(PaintingInfo.class);
            pi.setTextReview("Review #" + i);
            p.setToPaintingInfo(pi);
        }
        ctxt.commitChanges();
    }

}
View Full Code Here

        User user = context.newObject(User.class);
        user.setName("test_user");
        Group group = context.newObject(Group.class);
        group.setName("test_group");
        group.addToGroupMembers(user);
        context.commitChanges();

        context.deleteObject(user);
        assertTrue(group.getGroupMembers().isEmpty());

        context.commitChanges();
View Full Code Here

        context.commitChanges();

        context.deleteObject(user);
        assertTrue(group.getGroupMembers().isEmpty());

        context.commitChanges();

        // here Cayenne would throw per CAY-1378 on an attempt to delete a previously
        // related transient object
        context.deleteObject(group);
        context.commitChanges();
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.