Package org.apache.cayenne.testdo.relationship

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest2


        assertEquals(1, context.performQuery(joinSelect).size());
    }

    public void testQualifyOnToManyFlattened() throws Exception {
        FlattenedTest1 obj01 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj02 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj031 = context.newObject(FlattenedTest3.class);
        FlattenedTest3 obj032 = context.newObject(FlattenedTest3.class);

        FlattenedTest1 obj11 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj12 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj131 = context.newObject(FlattenedTest3.class);

        obj01.setName("t01");
        obj02.setName("t02");
        obj031.setName("t031");
        obj032.setName("t032");
        obj02.setToFT1(obj01);
        obj02.addToFt3Array(obj031);
        obj02.addToFt3Array(obj032);

        obj11.setName("t11");
        obj131.setName("t131");
        obj12.setName("t12");
        obj12.addToFt3Array(obj131);
        obj12.setToFT1(obj11);

        context.commitChanges();

        // test 1: qualify on flattened attribute
        Expression qual1 = ExpressionFactory.matchExp("ft3Array.name", "t031");
View Full Code Here


    }

    public void testToOneSeriesFlattenedRel() {
        FlattenedTest1 ft1 = (FlattenedTest1) context.newObject("FlattenedTest1");
        ft1.setName("FT1Name");
        FlattenedTest2 ft2 = (FlattenedTest2) context.newObject("FlattenedTest2");
        ft2.setName("FT2Name");
        FlattenedTest3 ft3 = (FlattenedTest3) context.newObject("FlattenedTest3");
        ft3.setName("FT3Name");

        ft2.setToFT1(ft1);
        ft2.addToFt3Array(ft3);
        context.commitChanges();

        context = createDataContext(); // We need a new context
        SelectQuery q = new SelectQuery(FlattenedTest3.class);
        q.setQualifier(ExpressionFactory.matchExp("name", "FT3Name"));
View Full Code Here

        assertEquals(1, context.performQuery(joinSelect).size());
    }

    public void testQualifyOnToManyFlattened() throws Exception {
        FlattenedTest1 obj01 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj02 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj031 = context.newObject(FlattenedTest3.class);
        FlattenedTest3 obj032 = context.newObject(FlattenedTest3.class);

        FlattenedTest1 obj11 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj12 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj131 = context.newObject(FlattenedTest3.class);

        obj01.setName("t01");
        obj02.setName("t02");
        obj031.setName("t031");
        obj032.setName("t032");
        obj02.setToFT1(obj01);
        obj02.addToFt3Array(obj031);
        obj02.addToFt3Array(obj032);

        obj11.setName("t11");
        obj131.setName("t131");
        obj12.setName("t12");
        obj12.addToFt3Array(obj131);
        obj12.setToFT1(obj11);

        context.commitChanges();

        // test 1: qualify on flattened attribute
        Expression qual1 = ExpressionFactory.matchExp("ft3Array.name", "t031");
View Full Code Here

    public void testToOneSeriesFlattenedRel() {

        FlattenedTest1 ft1 = (FlattenedTest1) context.newObject("FlattenedTest1");
        ft1.setName("FT1Name");
        FlattenedTest2 ft2 = (FlattenedTest2) context.newObject("FlattenedTest2");
        ft2.setName("FT2Name");
        FlattenedTest3 ft3 = (FlattenedTest3) context.newObject("FlattenedTest3");
        ft3.setName("FT3Name");

        ft2.setToFT1(ft1);
        ft2.addToFt3Array(ft3);
        context.commitChanges();

        context.invalidateObjects(ft1, ft2, ft3);

        SelectQuery q = new SelectQuery(FlattenedTest3.class);
View Full Code Here

        assertEquals(1, context.performQuery(joinSelect).size());
    }

    public void testQualifyOnToManyFlattened() throws Exception {
        FlattenedTest1 obj01 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj02 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj031 = context.newObject(FlattenedTest3.class);
        FlattenedTest3 obj032 = context.newObject(FlattenedTest3.class);

        FlattenedTest1 obj11 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj12 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj131 = context.newObject(FlattenedTest3.class);

        obj01.setName("t01");
        obj02.setName("t02");
        obj031.setName("t031");
        obj032.setName("t032");
        obj02.setToFT1(obj01);
        obj02.addToFt3Array(obj031);
        obj02.addToFt3Array(obj032);

        obj11.setName("t11");
        obj131.setName("t131");
        obj12.setName("t12");
        obj12.addToFt3Array(obj131);
        obj12.setToFT1(obj11);

        context.commitChanges();

        // test 1: qualify on flattened attribute
        Expression qual1 = ExpressionFactory.matchExp("ft3Array.name", "t031");
View Full Code Here

    }

    public void testToOneSeriesFlattenedRel() {
        FlattenedTest1 ft1 = (FlattenedTest1) context.newObject("FlattenedTest1");
        ft1.setName("FT1Name");
        FlattenedTest2 ft2 = (FlattenedTest2) context.newObject("FlattenedTest2");
        ft2.setName("FT2Name");
        FlattenedTest3 ft3 = (FlattenedTest3) context.newObject("FlattenedTest3");
        ft3.setName("FT3Name");

        ft2.setToFT1(ft1);
        ft2.addToFt3Array(ft3);
        context.commitChanges();

        context = createDataContext(); // We need a new context
        SelectQuery q = new SelectQuery(FlattenedTest3.class);
        q.setQualifier(ExpressionFactory.matchExp("name", "FT3Name"));
View Full Code Here

        assertEquals(1, context.performQuery(joinSelect).size());
    }

    public void testQualifyOnToManyFlattened() throws Exception {
        FlattenedTest1 obj01 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj02 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj031 = context.newObject(FlattenedTest3.class);
        FlattenedTest3 obj032 = context.newObject(FlattenedTest3.class);

        FlattenedTest1 obj11 = context.newObject(FlattenedTest1.class);
        FlattenedTest2 obj12 = context.newObject(FlattenedTest2.class);
        FlattenedTest3 obj131 = context.newObject(FlattenedTest3.class);

        obj01.setName("t01");
        obj02.setName("t02");
        obj031.setName("t031");
        obj032.setName("t032");
        obj02.setToFT1(obj01);
        obj02.addToFt3Array(obj031);
        obj02.addToFt3Array(obj032);

        obj11.setName("t11");
        obj131.setName("t131");
        obj12.setName("t12");
        obj12.addToFt3Array(obj131);
        obj12.setToFT1(obj11);

        context.commitChanges();

        // test 1: qualify on flattened attribute
        Expression qual1 = ExpressionFactory.matchExp("ft3Array.name", "t031");
View Full Code Here

    public void testToOneSeriesFlattenedRel() {

        FlattenedTest1 ft1 = (FlattenedTest1) context.newObject("FlattenedTest1");
        ft1.setName("FT1Name");
        FlattenedTest2 ft2 = (FlattenedTest2) context.newObject("FlattenedTest2");
        ft2.setName("FT2Name");
        FlattenedTest3 ft3 = (FlattenedTest3) context.newObject("FlattenedTest3");
        ft3.setName("FT3Name");

        ft2.setToFT1(ft1);
        ft2.addToFt3Array(ft3);
        context.commitChanges();

        context.invalidateObjects(ft1, ft2, ft3);

        SelectQuery q = new SelectQuery(FlattenedTest3.class);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.testdo.relationship.FlattenedTest2

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.