Examples of expWithParameters()


Examples of org.apache.cayenne.exp.Expression.expWithParameters()

    public void testMixedPrefetch1() throws Exception {

        createTwoArtistsWithExhibitsDataSet();

        Expression e = Expression.fromString("galleryName = $name");
        SelectQuery q = new SelectQuery(Gallery.class, e.expWithParameters(Collections
                .singletonMap("name", "gallery2")));
        q.addPrefetch("exhibitArray").setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
        q.addPrefetch("exhibitArray.artistExhibitArray");
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.expWithParameters()

    public void testMixedPrefetch2() throws Exception {

        createTwoArtistsWithExhibitsDataSet();

        Expression e = Expression.fromString("galleryName = $name");
        SelectQuery q = new SelectQuery(Gallery.class, e.expWithParameters(Collections
                .singletonMap("name", "gallery2")));

        // reverse the order of prefetches compared to the previous test
        q.addPrefetch("exhibitArray");
        q.addPrefetch("exhibitArray.artistExhibitArray").setSemantics(
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.expWithParameters()

     */
    public void testFailOnMissingParams() {
        Expression e1 = Expression.fromString("k1 = $test or k2 = 'v2' or k3 = 'v3'");

        try {
            e1.expWithParameters(Collections.EMPTY_MAP, false);
            fail("Parameter was missing, but no exception was thrown.");
        }
        catch (ExpressionException ex) {
            // exception expected
        }
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.expWithParameters()

    Calendar c = new GregorianCalendar();
    c.set(c.get(Calendar.YEAR) - 100, 0, 1, 0, 0, 0);

    Expression qualifier3 = Expression
        .fromString("artist.dateOfBirth < $date");
    qualifier3 = qualifier3.expWithParameters(Collections.singletonMap(
        "date", c.getTime()));
    SelectQuery select3 = new SelectQuery(Painting.class, qualifier3);
    List<Painting> paintings3 = context.performQuery(select3);
  }
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.expWithParameters()

    Calendar c = new GregorianCalendar();
    c.set(c.get(Calendar.YEAR) - 100, 0, 1, 0, 0, 0);

    Expression qualifier3 = Expression
        .fromString("artist.dateOfBirth < $date");
    qualifier3 = qualifier3.expWithParameters(Collections.singletonMap(
        "date", c.getTime()));
    SelectQuery select3 = new SelectQuery(Painting.class, qualifier3);
    List<Painting> paintings3 = context.performQuery(select3);
  }
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.expWithParameters()

    Calendar c = new GregorianCalendar();
    c.set(c.get(Calendar.YEAR) - 100, 0, 1, 0, 0, 0);

    Expression qualifier3 = Expression
        .fromString("artist.dateOfBirth < $date");
    qualifier3 = qualifier3.expWithParameters(Collections.singletonMap(
        "date", c.getTime()));
    SelectQuery select3 = new SelectQuery(Painting.class, qualifier3);
    List<Painting> paintings3 = objContext.performQuery(select3);
  }
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.