Examples of performGenericQuery()


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

        deleteTestData();
    }

    public void testAliasPathSplits_SinglePath() {
        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

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

    public void testAliasPathSplits_SinglePath() {
        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

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

                "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

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

        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')"));

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

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

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

        Artist a1 = DataObjectUtils.objectForPK(context, Artist.class, 1);
        Artist a2 = DataObjectUtils.objectForPK(context, Artist.class, 2);

        EJBQLQuery query = new EJBQLQuery(
View Full Code Here

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

            SQLTemplate insert = new SQLTemplate(
                    Artist.class,
                    "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME, SMALLINT_UNSIGNED) VALUES (1, 'A', 33000)");

            ObjectContext context = createDataContext();
            context.performGenericQuery(insert);

            SQLTemplate select = new SQLTemplate(Artist.class, "SELECT * FROM ARTIST");
            select.setColumnNamesCapitalization(CapsStrategy.UPPER);

            List<Artist> results = context.performQuery(select);
View Full Code Here

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

    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

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

        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

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

    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

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

        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.