Examples of ArtGroup


Examples of org.apache.cayenne.testdo.testmap.ArtGroup

    }
   
  }
 
  public void testReplaceDeleteNoCommit() {
    ArtGroup parentGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup1.setName("parent1");
    ArtGroup parentGroup2=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup2.setName("parent2");

    ArtGroup childGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    childGroup1.setName("child1");
    childGroup1.setToParentGroup(parentGroup1);


    childGroup1.setToParentGroup(parentGroup2);
    try {
      ctxt.deleteObject(parentGroup1);
      ctxt.deleteObject(parentGroup2);
    } catch (Exception e) {
      this.failWithException(e);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

      this.failWithException(e);
    }   
  }
 
  public void testReplaceDeleteWithCommit() {
    ArtGroup parentGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup1.setName("parent1");
    ArtGroup parentGroup2=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup2.setName("parent2");

    ArtGroup childGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    childGroup1.setName("child1");
    childGroup1.setToParentGroup(parentGroup1);
    childGroup1.setToParentGroup(parentGroup2);
    ctxt.commitChanges();

    try {
      ctxt.deleteObject(parentGroup1);
      ctxt.deleteObject(parentGroup2);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

      this.failWithException(e);
    }   
  }
 
  public void testCommitReplaceCommit() {
    ArtGroup parentGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup1.setName("parent1");
    ArtGroup parentGroup2=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup2.setName("parent2");

    ArtGroup childGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    childGroup1.setName("child1");
    childGroup1.setToParentGroup(parentGroup1);
    ctxt.commitChanges();
    childGroup1.setToParentGroup(parentGroup2);
    ctxt.commitChanges();
  }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

    childGroup1.setToParentGroup(parentGroup2);
    ctxt.commitChanges();
  }

  public void testComplexInsertUpdateOrdering() {
    ArtGroup parentGroup=(ArtGroup)ctxt.newObject("ArtGroup");
    parentGroup.setName("parent");
    ctxt.commitChanges();
   
    //Check that the update and insert both work write
    ArtGroup childGroup1=(ArtGroup)ctxt.newObject("ArtGroup");
    childGroup1.setName("child1");
    childGroup1.setToParentGroup(parentGroup);
    ctxt.commitChanges();
  }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

                "g1"));
        List results = context.performQuery(q);
        assertEquals(1, results.size());

        assertFalse(context.hasChanges());
        ArtGroup group = (ArtGroup) results.get(0);
        a1.addToGroupArray(group);
        assertTrue(context.hasChanges());

        List groupList = a1.getGroupArray();
        assertEquals(1, groupList.size());
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

                "name",
                "g1"));
        List results = context.performQuery(q);
        assertEquals(1, results.size());

        ArtGroup group = (ArtGroup) results.get(0);
        a1.addToGroupArray(group);

        List groupList = a1.getGroupArray();
        assertEquals(1, groupList.size());
        assertEquals("g1", ((ArtGroup) groupList.get(0)).getName());
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

        createTestData("testRemoveFromFlattenedRelationship");
        DataContext context = createDataContext();

        Artist a1 = Cayenne.objectForPK(context, Artist.class, 33001);

        ArtGroup group = a1.getGroupArray().get(0);
        a1.removeFromGroupArray(group);

        List groupList = a1.getGroupArray();
        assertEquals(0, groupList.size());
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

    public void testRemoveFlattenedRelationshipAndRootRecord() throws Exception {
        DataContext context = createDataContext();
        createTestData("testRemoveFlattenedRelationshipAndRootRecord");
        Artist a1 = Cayenne.objectForPK(context, Artist.class, 33001);

        ArtGroup group = a1.getGroupArray().get(0);
        a1.removeFromGroupArray(group); // Cause the delete of the link record

        context.deleteObject(a1); // Cause the deletion of the artist

        try {
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

                "name",
                "g1"));
        List results = context.performQuery(q);
        assertEquals(1, results.size());

        ArtGroup group = (ArtGroup) results.get(0);
        a1.addToGroupArray(group);
        group.removeFromArtistArray(a1);

        blockQueries();
        try {
            context.commitChanges();
        }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ArtGroup

        SelectQuery q = new SelectQuery(ArtGroup.class);
        List results = context.performQuery(q);
        assertEquals(2, results.size());

        ArtGroup g1 = (ArtGroup) results.get(0);
        ArtGroup g2 = (ArtGroup) results.get(1);
        a1.addToGroupArray(g1);
        a1.addToGroupArray(g2);

        // test that there is no delete query issued when a flattened join is first
        // added
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.