Examples of QueryChain


Examples of org.apache.cayenne.query.QueryChain

    public void testRefreshingToOne() {

        ObjectContext context = createDataContext();

        QueryChain chain = new QueryChain();
        chain.addQuery(new SQLTemplate(
                Artist.class,
                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (1, 'a1')"));
        chain
                .addQuery(new SQLTemplate(
                        Painting.class,
                        "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE) VALUES (1, 1, 'p1')"));

        context.performQuery(chain);
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        runInTransaction(new Transformer() {

            public Object transform(Object input) {
                new DataDomainLegacyQueryAction(
                        DataDomain.this,
                        new QueryChain(queries),
                        callback).execute();
                return null;
            }
        });
    }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        Transaction old = Transaction.getThreadTransaction();
        Transaction.bindThreadTransaction(transaction);

        try {
            new DataDomainLegacyQueryAction(this, new QueryChain(queries), callback)
                    .execute();
        }
        finally {
            Transaction.bindThreadTransaction(old);
        }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        runInTransaction(new Transformer() {

            public Object transform(Object input) {
                new DataDomainLegacyQueryAction(
                        DataDomain.this,
                        new QueryChain(queries),
                        callback).execute();
                return null;
            }
        });
    }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

    public void performQueries(final Collection<? extends Query> queries, final OperationObserver callback) {

        runInTransaction(new Transformer() {

            public Object transform(Object input) {
                new DataDomainLegacyQueryAction(DataDomain.this, new QueryChain(queries), callback).execute();
                return null;
            }
        });
    }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

    context.commitChanges();
  }

  static void mappingQueriesChapter(ObjectContext context) {

    QueryChain chain = new QueryChain();
    chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
        "table", "PAINTING")));
    chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
        "table", "ARTIST")));
    chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
        "table", "GALLERY")));

    context.performGenericQuery(chain);

  }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        context.commitChanges();
    }

    static void mappingQueriesChapter(DataContext context) {

        QueryChain chain = new QueryChain();
        chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
                "table",
                "PAINTING")));
        chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
                "table",
                "ARTIST")));
        chain.addQuery(new NamedQuery("DeleteAll", Collections.singletonMap(
                "table",
                "GALLERY")));

        context.performGenericQuery(chain);
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        Object object = factory.getBean(testName);
        if (object == null) {
            throw new RuntimeException("No query exists for test name:" + testName);
        }

        QueryChain chain = new QueryChain();

        if (object instanceof Collection) {
            Iterator it = ((Collection) object).iterator();
            while (it.hasNext()) {
                chain.addQuery(processQuery((Query) it.next(), parameters));
            }
        }
        else if (object instanceof Query) {
            chain.addQuery(processQuery((Query) object, parameters));
        }
        else {
            throw new RuntimeException("Invalid object type for name '"
                    + testName
                    + "': "
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        runInTransaction(new Transformer() {

            public Object transform(Object input) {
                new DataDomainLegacyQueryAction(
                        DataDomain.this,
                        new QueryChain(queries),
                        callback).execute();
                return null;
            }
        });
    }
View Full Code Here

Examples of org.apache.cayenne.query.QueryChain

        runInTransaction(new Transformer() {

            public Object transform(Object input) {
                new DataDomainLegacyQueryAction(
                        DataDomain.this,
                        new QueryChain(queries),
                        callback).execute();
                return null;
            }
        });
    }
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.