Package org.apache.cayenne

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


        altA.setGlobalAttribute1("Y");
        clientContext.commitChanges();

        ObjectContext peer1 = clientContext.createChildContext();
        ClientMtTable2 p1 = (ClientMtTable2) peer1.localObject(p.getObjectId(), p);
        ClientMtTable1 altA1 = (ClientMtTable1) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 p2 = (ClientMtTable2) peer2.localObject(p.getObjectId(), p);
        ClientMtTable1 altA2 = (ClientMtTable1) peer2.localObject(altA.getObjectId(), altA);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);
View Full Code Here


        ObjectContext peer1 = clientContext.createChildContext();
        ClientMtTable2 p1 = (ClientMtTable2) peer1.localObject(p.getObjectId(), p);
        ClientMtTable1 altA1 = (ClientMtTable1) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 p2 = (ClientMtTable2) peer2.localObject(p.getObjectId(), p);
        ClientMtTable1 altA2 = (ClientMtTable1) peer2.localObject(altA.getObjectId(), altA);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);

        p1.setTable1(altA1);
        assertSame(a2, p2.getTable1());
View Full Code Here

        ClientMtTable2 p1 = (ClientMtTable2) peer1.localObject(p.getObjectId(), p);
        ClientMtTable1 altA1 = (ClientMtTable1) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 p2 = (ClientMtTable2) peer2.localObject(p.getObjectId(), p);
        ClientMtTable1 altA2 = (ClientMtTable1) peer2.localObject(altA.getObjectId(), altA);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);

        p1.setTable1(altA1);
        assertSame(a2, p2.getTable1());
        peer1.commitChangesToParent();
View Full Code Here

        ClientMtTable1 altA1 = (ClientMtTable1) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 p2 = (ClientMtTable2) peer2.localObject(p.getObjectId(), p);
        ClientMtTable1 altA2 = (ClientMtTable1) peer2.localObject(altA.getObjectId(), altA);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);

        p1.setTable1(altA1);
        assertSame(a2, p2.getTable1());
        peer1.commitChangesToParent();
        assertEquals(altA2, p2.getTable1());
View Full Code Here

        py.setGlobalAttribute("PY");

        clientContext.commitChanges();

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

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 py2 = (ClientMtTable2) peer2.localObject(py.getObjectId(), py);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);
View Full Code Here

        clientContext.commitChanges();

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

        ObjectContext peer2 = clientContext.createChildContext();
        ClientMtTable2 py2 = (ClientMtTable2) peer2.localObject(py.getObjectId(), py);
        ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);
View Full Code Here

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

        ObjectContext peer2 = clientContext.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));
View Full Code Here

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

        ObjectContext peer2 = clientContext.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

        }

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

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

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

        }

        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

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.