Package org.apache.cayenne.itest.cpa.defaults

Examples of org.apache.cayenne.itest.cpa.defaults.DefaultsTable3


        new String[] { "id", "defaults_table3_id" },
        new Object[] { 1, 1 });

    DefaultsTable4 o = (DefaultsTable4) DataObjectUtils.objectForPK(
        getContext(), DefaultsTable4.class, 1);
    DefaultsTable3 o1 = (DefaultsTable3) DataObjectUtils.objectForPK(
        getContext(), DefaultsTable3.class, 1);
    DefaultsTable3 o2 = (DefaultsTable3) DataObjectUtils.objectForPK(
        getContext(), DefaultsTable3.class, 2);

    assertEquals(1, o1.getDefaultTable4s().size());
    assertEquals(0, o2.getDefaultTable4s().size());

    o2.addToDefaultTable4s(o);

    assertEquals(1, o2.getDefaultTable4s().size());
    getContext().commitChanges();
    assertEquals(1, o2.getDefaultTable4s().size());

    getContext().performQuery(new RefreshQuery());

    // note that the old to-many is only refreshed after invalidation with
    // RefreshQuery... should this be treated as a bug?
    assertEquals(0, o1.getDefaultTable4s().size());
    assertEquals(1, o2.getDefaultTable4s().size());
  }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.itest.cpa.defaults.DefaultsTable3

Copyright © 2018 www.massapicom. 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.