Package org.apache.art

Examples of org.apache.art.ArtGroup


    }

    public void testReflexiveRelationshipInsertOrder4() {
        // Tey multiple children, one created before parent, one after
        DataContext dc = this.createDataContext();
        ArtGroup childGroup1 = (ArtGroup) dc.newObject("ArtGroup");
        childGroup1.setName("child1");

        ArtGroup parentGroup = (ArtGroup) dc.newObject("ArtGroup");
        parentGroup.setName("parent");

        childGroup1.setToParentGroup(parentGroup);

        ArtGroup childGroup2 = (ArtGroup) dc.newObject("ArtGroup");
        childGroup2.setName("subchild");
        childGroup2.setToParentGroup(childGroup1);

        dc.commitChanges();
    }
View Full Code Here


                "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

                "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

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

        Artist a1 = DataObjectUtils.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

    public void testRemoveFlattenedRelationshipAndRootRecord() throws Exception {
        DataContext context = createDataContext();
        createTestData("testRemoveFlattenedRelationshipAndRootRecord");
        Artist a1 = DataObjectUtils.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

                "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

        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

Related Classes of org.apache.art.ArtGroup

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.