Package org.apache.cayenne.testdo.inherit

Examples of org.apache.cayenne.testdo.inherit.AbstractPerson


                "INSERT INTO PERSON_NOTES (ID, NOTES, PERSON_ID) VALUES (4, 'BB', 3)"));

        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY);

        AbstractPerson person = (AbstractPerson) Cayenne.objectForQuery(
                createDataContext(),
                query);

        assertTrue(person instanceof Employee);

        blockQueries();
        try {
            assertEquals(2, person.getNotes().size());

            String[] names = new String[2];
            names[0] = person.getNotes().get(0).getNotes();
            names[1] = person.getNotes().get(1).getNotes();
            List<String> nameSet = Arrays.asList(names);

            assertTrue(nameSet.contains("AA"));
            assertTrue(nameSet.contains("BB"));
        }
View Full Code Here


        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        AbstractPerson person = (AbstractPerson) Cayenne.objectForQuery(
                createDataContext(),
                query);

        assertTrue(person instanceof Employee);

        blockQueries();
        try {
            assertEquals(2, person.getNotes().size());

            String[] names = new String[2];
            names[0] = person.getNotes().get(0).getNotes();
            names[1] = person.getNotes().get(1).getNotes();
            List<String> nameSet = Arrays.asList(names);

            assertTrue(nameSet.contains("AA"));
            assertTrue(nameSet.contains("BB"));
        }
View Full Code Here

        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        AbstractPerson person = (AbstractPerson) DataObjectUtils.objectForQuery(
                createDataContext(),
                query);

        assertTrue(person instanceof Employee);

        blockQueries();
        try {
            assertEquals(2, person.getNotes().size());

            String[] names = new String[2];
            names[0] = person.getNotes().get(0).getNotes();
            names[1] = person.getNotes().get(1).getNotes();
            List<String> nameSet = Arrays.asList(names);

            assertTrue(nameSet.contains("AA"));
            assertTrue(nameSet.contains("BB"));
        }
View Full Code Here

                "INSERT INTO PERSON_NOTES (ID, NOTES, PERSON_ID) VALUES (4, 'BB', 3)"));

        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY);

        AbstractPerson person = (AbstractPerson) DataObjectUtils.objectForQuery(
                createDataContext(),
                query);

        assertTrue(person instanceof Employee);

        blockQueries();
        try {
            assertEquals(2, person.getNotes().size());

            String[] names = new String[2];
            names[0] = person.getNotes().get(0).getNotes();
            names[1] = person.getNotes().get(1).getNotes();
            List<String> nameSet = Arrays.asList(names);

            assertTrue(nameSet.contains("AA"));
            assertTrue(nameSet.contains("BB"));
        }
View Full Code Here

        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        final AbstractPerson person = (AbstractPerson) Cayenne.objectForQuery(
                context,
                query);

        assertTrue(person instanceof Employee);

        queryBlocker.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(2, person.getNotes().size());

                String[] names = new String[2];
                names[0] = person.getNotes().get(0).getNotes();
                names[1] = person.getNotes().get(1).getNotes();
                List<String> nameSet = Arrays.asList(names);

                assertTrue(nameSet.contains("AA"));
                assertTrue(nameSet.contains("BB"));
            }
View Full Code Here

                "INSERT INTO PERSON_NOTES (ID, NOTES, PERSON_ID) VALUES (4, 'BB', 3)"));

        SelectQuery query = new SelectQuery(AbstractPerson.class);
        query.addPrefetch(AbstractPerson.NOTES_PROPERTY);

        final AbstractPerson person = (AbstractPerson) Cayenne.objectForQuery(
                context,
                query);
        assertTrue(person instanceof Employee);

        queryBlocker.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(2, person.getNotes().size());

                String[] names = new String[2];
                names[0] = person.getNotes().get(0).getNotes();
                names[1] = person.getNotes().get(1).getNotes();
                List<String> nameSet = Arrays.asList(names);

                assertTrue(nameSet.contains("AA"));
                assertTrue(nameSet.contains("BB"));
            }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.testdo.inherit.AbstractPerson

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.