Examples of declareVariables()


Examples of javax.jdo.Query.declareVariables()

    // sort on parent can only be by join column in asc order
    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10 order by grade");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    // sort is by the join column but in the wrong order
    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10 order by courses desc");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    // can't sort by child property
    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10 order by c.department");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    beginTxn();
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    assertEquals(Collections.singletonList(student), q.execute());
    commitTxn();
  }

  public void testJoinOnOneToMany_LegalOrderBy() {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    beginTxn();
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10 order by courses asc");
    q.declareVariables(Course.class.getName() + " c");
    assertEquals(Collections.singletonList(student), q.execute());
    commitTxn();
  }

  public void testJoinOnOneToMany_Offset() {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    beginTxn();
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    q.setRange(1, Long.MAX_VALUE);
    assertEquals(Collections.singletonList(student3), q.execute());
    q.setRange(2, Long.MAX_VALUE);
    assertEquals(Collections.emptyList(), q.execute());
    commitTxn();
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    beginTxn();
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    q.setRange(0, 1);
    assertEquals(Collections.singletonList(student), q.execute());
    q.setRange(0, 0);
    assertEquals(Collections.emptyList(), q.execute());
    commitTxn();
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    beginTxn();
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "major == m && m.school == 'Liberal Arts' && "
        + "grade == 10");
    q.declareVariables(Major.class.getName() + " m");
    assertEquals(Collections.singletonList(student1), q.execute());
    commitTxn();
  }

  public void testJoinOnOneToMany_Illegal() {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    // join condition can't be >
    Query q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses > c && c.department == 'Biology' && "
        + "grade == 10");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
View Full Code Here

Examples of javax.jdo.Query.declareVariables()

    // all filters on parent must be equality filters
    q = pm.newQuery(
        "select from " + Student.class.getName() + " where "
        + "courses.contains(c) && c.department == 'Biology' && "
        + "grade > 10");
    q.declareVariables(Course.class.getName() + " c");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected exception");
    } catch (JDOUserException jdoe) {
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.