Package org.apache.isis.core.tck.dom.poly

Examples of org.apache.isis.core.tck.dom.poly.SelfReferencingEntity


        final StringableEntityWithOwnProperties object = newTransientInstance(StringableEntityWithOwnProperties.class);
        return object;
    }

    public SelfReferencingEntity newPolySelfRefClass() {
        final SelfReferencingEntity object = newTransientInstance(SelfReferencingEntity.class);
        return object;
    }
View Full Code Here


        final ReferencingPolyTypesEntity referencingPolyTypesEntity = factory.newPolyTestClass();
        referencingPolyTypesEntity.setString("polyTestClassString");

        // Setup self-referencing collection
        final SelfReferencingEntity polySelfRefClassParent = factory.newPolySelfRefClass();
        polySelfRefClassParent.setString("Parent");

        final SelfReferencingEntity polySelfRefClassChild1 = factory.newPolySelfRefClass();
        polySelfRefClassChild1.setString(CHILD_1);
        polySelfRefClassParent.addToPolySelfRefClasses(polySelfRefClassChild1);

        final SelfReferencingEntity polySelfRefClassChild2 = factory.newPolySelfRefClass();
        polySelfRefClassChild2.setString("Child 2");
        polySelfRefClassParent.addToPolySelfRefClasses(polySelfRefClassChild2);
        factory.save(polySelfRefClassChild2);

        final SelfReferencingEntity polySelfRefClassChild3 = factory.newPolySelfRefClass();
        polySelfRefClassChild3.setString("Child 1 of Child 1");
        polySelfRefClassChild1.addToPolySelfRefClasses(polySelfRefClassChild3);

        factory.save(polySelfRefClassChild3);
        factory.save(polySelfRefClassChild1);
View Full Code Here

        factory.resolve(loaded);
        assertEquals(polyIntImpA.getString(), loaded.getString());
    }

    private void loadSelfReferencingCollection() {
        final SelfReferencingEntity polySelfRefParent = referencingPolyTypesEntity.getPolySelfRefClass();
        final List<SelfReferencingEntity> list = polySelfRefParent.getPolySelfRefClasses();
        assertEquals(2, list.size());

        SelfReferencingEntity polySelfRefChild1 = null;
        for (final SelfReferencingEntity selfReferencingEntity : list) {
            if (selfReferencingEntity.getString().equals(CHILD_1)) {
                polySelfRefChild1 = selfReferencingEntity;
            }
        }
        assertNotNull(polySelfRefChild1);

        assertEquals(CHILD_1, polySelfRefChild1.title());

        List<SelfReferencingEntity> list2 = polySelfRefChild1.getPolySelfRefClasses();
        factory.resolve(polySelfRefChild1);
        list2 = polySelfRefChild1.getPolySelfRefClasses();
        assertEquals(1, list2.size());
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.tck.dom.poly.SelfReferencingEntity

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.