Package org.apache.cayenne

Examples of org.apache.cayenne.ObjectContext.performGenericQuery()


    @Override
    protected void tearDown() throws Exception {
        // help in cleaning up relationship cycles...
        ObjectContext context = createDataContext();
        context.performGenericQuery(new SQLTemplate(
                Department.class,
                "update DEPARTMENT set MANAGER_ID = NULL"));
    }

    public void testCollectionMemberOfId() throws Exception {
View Full Code Here


        assertEquals("AA", artists.get(0).getArtistName());
    }

    public void testAliasPathSplits_SplitJoin() {
        ObjectContext context = createDataContext();
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (1, 'AA')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (2, 'BB')"));
View Full Code Here

    public void testAliasPathSplits_SplitJoin() {
        ObjectContext context = createDataContext();
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (1, 'AA')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (2, 'BB')"));

        context.performGenericQuery(new SQLTemplate(
                Artist.class,
View Full Code Here

                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (1, 'AA')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (2, 'BB')"));

        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE) "
                        + "VALUES (1, 1, 'X')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
View Full Code Here

        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE) "
                        + "VALUES (1, 1, 'X')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE)"
                        + " VALUES (2, 2, 'Y')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
View Full Code Here

                        + "VALUES (1, 1, 'X')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE)"
                        + " VALUES (2, 2, 'Y')"));
        context.performGenericQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE)"
                        + " VALUES (3, 2, 'X')"));

        SelectQuery query = new SelectQuery(Artist.class);
View Full Code Here

    public void testSelectQuery() throws Exception {
        deleteTestData();
        ObjectContext context = createDataContext();

        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (1, 'two')"));
        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (2, 'one')"));
View Full Code Here

        ObjectContext context = createDataContext();

        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (1, 'two')"));
        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (2, 'one')"));

        SelectQuery q = new SelectQuery(EnumEntity.class);
        q.andQualifier(ExpressionFactory.matchExp(
View Full Code Here

    public void testSQLTemplate() throws Exception {
        deleteTestData();
        ObjectContext context = createDataContext();

        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (1, 'two')"));
        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (2, 'one')"));
View Full Code Here

        ObjectContext context = createDataContext();

        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (1, 'two')"));
        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (2, 'one')"));

        SQLTemplate q = new SQLTemplate(
                EnumEntity.class,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.