Package org.apache.art

Examples of org.apache.art.CompoundFkTestEntity


        query.setParameters(Collections.singletonMap("a", a));

        List objects = context.performQuery(query);
        assertEquals(1, objects.size());

        CompoundFkTestEntity p = (CompoundFkTestEntity) objects.get(0);
        assertEquals(33001, DataObjectUtils.intPKForObject(p));
    }
View Full Code Here


        query.setParameters(Collections.singletonMap("a", a));

        List objects = context.performQuery(query);
        assertEquals(1, objects.size());

        CompoundFkTestEntity p = (CompoundFkTestEntity) objects.get(0);
        assertEquals(33002, DataObjectUtils.intPKForObject(p));
    }
View Full Code Here

    }

    public void testInsert() {
        CompoundPkTestEntity master = ctxt
                .newObject(CompoundPkTestEntity.class);
        CompoundFkTestEntity detail = ctxt
                .newObject(CompoundFkTestEntity.class);
        master.addToCompoundFkArray(detail);
        master.setName("m1");
        master.setKey1("key11");
        master.setKey2("key21");
        detail.setName("d1");

        ctxt.commitChanges();

        // reset context
        ctxt = createDataContext();

        SelectQuery q = new SelectQuery(CompoundPkTestEntity.class);
        List<?> objs = ctxt.performQuery(q);
        assertEquals(1, objs.size());

        master = (CompoundPkTestEntity) objs.get(0);
        assertEquals("m1", master.getName());

        List<?> details = master.getCompoundFkArray();
        assertEquals(1, details.size());
        detail = (CompoundFkTestEntity) details.get(0);

        assertEquals("d1", detail.getName());
    }
View Full Code Here

    public void testFetchQualifyingToOne() {
        CompoundPkTestEntity master = (CompoundPkTestEntity) ctxt
                .newObject("CompoundPkTestEntity");
        CompoundPkTestEntity master1 = (CompoundPkTestEntity) ctxt
                .newObject("CompoundPkTestEntity");
        CompoundFkTestEntity detail = (CompoundFkTestEntity) ctxt
                .newObject("CompoundFkTestEntity");
        CompoundFkTestEntity detail1 = (CompoundFkTestEntity) ctxt
                .newObject("CompoundFkTestEntity");
        master.addToCompoundFkArray(detail);
        master1.addToCompoundFkArray(detail1);

        master.setName("m1");
        master.setKey1("key11");
        master.setKey2("key21");

        master1.setName("m2");
        master1.setKey1("key12");
        master1.setKey2("key22");

        detail.setName("d1");

        detail1.setName("d2");

        ctxt.commitChanges();

        // reset context
        ctxt = createDataContext();
View Full Code Here

    public void testFetchQualifyingToMany() throws Exception {
        CompoundPkTestEntity master = (CompoundPkTestEntity) ctxt
                .newObject("CompoundPkTestEntity");
        CompoundPkTestEntity master1 = (CompoundPkTestEntity) ctxt
                .newObject("CompoundPkTestEntity");
        CompoundFkTestEntity detail = (CompoundFkTestEntity) ctxt
                .newObject("CompoundFkTestEntity");
        CompoundFkTestEntity detail1 = (CompoundFkTestEntity) ctxt
                .newObject("CompoundFkTestEntity");
        master.addToCompoundFkArray(detail);
        master1.addToCompoundFkArray(detail1);

        master.setName("m1");
        master.setKey1("key11");
        master.setKey2("key21");

        master1.setName("m2");
        master1.setKey1("key12");
        master1.setKey2("key22");

        detail.setName("d1");

        detail1.setName("d2");

        ctxt.commitChanges();

        // reset context
        ctxt = createDataContext();
View Full Code Here

        query.setParameter("param", a);

        List ps = context.performQuery(query);
        assertEquals(1, ps.size());

        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
        assertEquals(33002, DataObjectUtils.intPKForObject(o1));
    }
View Full Code Here

        query.setParameter("param", a);

        List ps = context.performQuery(query);
        assertEquals(1, ps.size());

        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
        assertEquals(33002, DataObjectUtils.intPKForObject(o1));
    }
View Full Code Here

        query.setParameter("param", a);

        List ps = context.performQuery(query);
        assertEquals(1, ps.size());

        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
        assertEquals(33001, DataObjectUtils.intPKForObject(o1));
    }
View Full Code Here

TOP

Related Classes of org.apache.art.CompoundFkTestEntity

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.