Package org.apache.cayenne.testdo.relationship

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


    }

    public void testQualifyOnToMany() {
        DataContext context = createDataContext();

        ReflexiveAndToOne ox = context
                .newObject(ReflexiveAndToOne.class);
        ox.setName("ox");
        ReflexiveAndToOne o1 = context
                .newObject(ReflexiveAndToOne.class);
        o1.setName("o1");

        ReflexiveAndToOne o2 = context
                .newObject(ReflexiveAndToOne.class);
        o2.setName("o2");
        o2.setToParent(o1);

        context.commitChanges();

        Expression qualifier = ExpressionFactory.matchExp("children", o2);
        List parents = context.performQuery(new SelectQuery(
View Full Code Here


    }

    public void testQualifyOnToOne() {
        DataContext context = createDataContext();

        ReflexiveAndToOne ox = context
                .newObject(ReflexiveAndToOne.class);
        ox.setName("ox");
        ReflexiveAndToOne o1 = context
                .newObject(ReflexiveAndToOne.class);
        o1.setName("o1");

        ReflexiveAndToOne o2 = context
                .newObject(ReflexiveAndToOne.class);
        o2.setName("o2");
        o2.setToParent(o1);

        context.commitChanges();

        Expression qualifier = ExpressionFactory.matchExp("toParent", o1);
        List children = context.performQuery(new SelectQuery(
View Full Code Here

        dbHelper.deleteAll("TO_ONEFK1");
    }

    public void testQualifyOnToMany() {

        ReflexiveAndToOne ox = context.newObject(ReflexiveAndToOne.class);
        ox.setName("ox");
        ReflexiveAndToOne o1 = context.newObject(ReflexiveAndToOne.class);
        o1.setName("o1");

        ReflexiveAndToOne o2 = context.newObject(ReflexiveAndToOne.class);
        o2.setName("o2");
        o2.setToParent(o1);

        context.commitChanges();

        Expression qualifier = ExpressionFactory.matchExp("children", o2);
        List<?> parents = context.performQuery(new SelectQuery(
View Full Code Here

        assertEquals(0, parents.size());
    }

    public void testQualifyOnToOne() {

        ReflexiveAndToOne ox = context.newObject(ReflexiveAndToOne.class);
        ox.setName("ox");
        ReflexiveAndToOne o1 = context.newObject(ReflexiveAndToOne.class);
        o1.setName("o1");

        ReflexiveAndToOne o2 = context.newObject(ReflexiveAndToOne.class);
        o2.setName("o2");
        o2.setToParent(o1);

        context.commitChanges();

        Expression qualifier = ExpressionFactory.matchExp("toParent", o1);
        List<?> children = context.performQuery(new SelectQuery(
View Full Code Here

TOP

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

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.