Examples of localObject()


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

        ClientMtTable2 py1 = (ClientMtTable2) peer1.localObject(py.getObjectId(), py);
        ClientMtTable1 a1 = (ClientMtTable1) peer1.localObject(a.getObjectId(), a);

        ObjectContext peer2 = context.createChildContext();
        ClientMtTable2 py2 = (ClientMtTable2) peer2.localObject(py.getObjectId(), py);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);

        a1.addToTable2Array(py1);
        assertEquals(1, a2.getTable2Array().size());
        assertFalse(a2.getTable2Array().contains(py2));
        peer1.commitChangesToParent();
View Full Code Here

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

        }

        DataRow snapshot = (DataRow) result.get(0);

        ObjectId id = snapshot.createTargetObjectId(targetEntityName, finalRel);
        return (id != null) ? context.localObject(id, null) : null;
    }

    protected Comparator getDbEntityComparator(boolean dependantFirst) {
        Comparator c = dbEntityComparator;
        if (dependantFirst) {
View Full Code Here

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

        interceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                Artist a3 = nestedContext.localObject(a1);
                assertNotSame(a3, a1);
                assertEquals(a3.getObjectId(), a1.getObjectId());
                assertSame(nestedContext, a3.getObjectContext());
            }
        });
View Full Code Here

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

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                Persistent hollowPeer = peerContext.localObject(
                        hollow.getObjectId(),
                        null);
                assertEquals(PersistenceState.HOLLOW, hollowPeer.getPersistenceState());
                assertEquals(hollow.getObjectId(), hollowPeer.getObjectId());
                assertSame(peerContext, hollowPeer.getObjectContext());
View Full Code Here

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

                assertEquals(PersistenceState.HOLLOW, hollowPeer.getPersistenceState());
                assertEquals(hollow.getObjectId(), hollowPeer.getObjectId());
                assertSame(peerContext, hollowPeer.getObjectContext());
                assertSame(context, hollow.getObjectContext());

                Persistent committedPeer = peerContext.localObject(
                        committed.getObjectId(),
                        null);
                assertEquals(PersistenceState.HOLLOW, committedPeer.getPersistenceState());
                assertEquals(committed.getObjectId(), committedPeer.getObjectId());
                assertSame(peerContext, committedPeer.getObjectContext());
View Full Code Here

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

                assertEquals(PersistenceState.HOLLOW, committedPeer.getPersistenceState());
                assertEquals(committed.getObjectId(), committedPeer.getObjectId());
                assertSame(peerContext, committedPeer.getObjectContext());
                assertSame(context, committed.getObjectContext());

                Persistent modifiedPeer = peerContext.localObject(
                        modified.getObjectId(),
                        null);
                assertEquals(PersistenceState.HOLLOW, modifiedPeer.getPersistenceState());
                assertEquals(modified.getObjectId(), modifiedPeer.getObjectId());
                assertSame(peerContext, modifiedPeer.getObjectContext());
View Full Code Here

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

                assertEquals(PersistenceState.HOLLOW, modifiedPeer.getPersistenceState());
                assertEquals(modified.getObjectId(), modifiedPeer.getObjectId());
                assertSame(peerContext, modifiedPeer.getObjectContext());
                assertSame(context, modified.getObjectContext());

                Persistent deletedPeer = peerContext.localObject(
                        deleted.getObjectId(),
                        null);
                assertEquals(PersistenceState.HOLLOW, deletedPeer.getPersistenceState());
                assertEquals(deleted.getObjectId(), deletedPeer.getObjectId());
                assertSame(peerContext, deletedPeer.getObjectContext());
View Full Code Here

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

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                Persistent peerModified2 = peerContext.localObject(
                        modified.getObjectId(),
                        null);

                assertSame(peerModified, peerModified2);
                assertEquals(
View Full Code Here

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

        // now check how objects in different state behave

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Persistent newPeer = childContext.localObject(_new.getObjectId(), _new);

                assertEquals(_new.getObjectId(), newPeer.getObjectId());
                assertEquals(PersistenceState.COMMITTED, newPeer.getPersistenceState());

                assertSame(childContext, newPeer.getObjectContext());
View Full Code Here

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

                assertEquals(PersistenceState.COMMITTED, newPeer.getPersistenceState());

                assertSame(childContext, newPeer.getObjectContext());
                assertSame(context, _new.getObjectContext());

                Persistent hollowPeer = childContext.localObject(
                        hollow.getObjectId(),
                        hollow);
                assertEquals(PersistenceState.HOLLOW, hollowPeer.getPersistenceState());
                assertEquals(hollow.getObjectId(), hollowPeer.getObjectId());
                assertSame(childContext, hollowPeer.getObjectContext());
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.