Package javax.jdo

Examples of javax.jdo.Query.addExtension()


    Key key = ds.put(null, e);
    e = new Entity(HasOneToOneParentJDO.class.getSimpleName(), key);
    ds.put(null, e);
    Query q = pm.newQuery(
        "select from " + HasOneToOneParentJDO.class.getName() + " where parent == null");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute();
      fail("expected");
    } catch (JDOFatalUserException ex) {
      // good
View Full Code Here


    Flight flight = fp.getFlight(flightEntity.getKey());
    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where flight > f parameters " + Flight.class.getName() + " f");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute(flight);
      fail("expected udfe");
    } catch (JDOUserException jdoe) {
        if (jdoe.getCause() instanceof DatastoreQuery.UnsupportedDatastoreFeatureException) {
View Full Code Here

    Flight flight = fp.getFlight(flightEntity.getKey());
    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where flight == f parameters " + Flight.class.getName() + " f");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute(flight);
      fail("expected JDOException");
    } catch (JDOException e) {
      // good
View Full Code Here

    ds.put(null, parentEntity);

    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where flight == f parameters " + Flight.class.getName() + " f");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute(parentEntity.getKey());
      fail("expected JDOException");
    } catch (JDOException e) {
      // good
View Full Code Here

    Flight flight = new Flight();
    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where flight == f parameters " + Flight.class.getName() + " f");
    q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
    try {
      q.execute(flight);
      fail("expected JDOException");
    } catch (JDOException e) {
      // good
View Full Code Here

  public void testFilterBySubObject_UnknownField() {
    try {
      Query q = pm.newQuery(
          "select from " + Flight.class.getName() + " where origin.doesnotexist == \"max\"");
      q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
      q.execute();
      fail("expected exception");
    } catch (JDOFatalUserException e) {
      // good
    }
View Full Code Here

  public void testFilterBySubObject_NotEmbeddable() {
    try {
      Query q = pm.newQuery(
          "select from " + HasOneToOneJDO.class.getName() + " where flight.origin == \"max\"");
      q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
      q.execute();
      fail("expected exception");
    } catch (JDOFatalUserException e) {
      // good
    }
View Full Code Here

  }

  public void testSortBySubObject_UnknownField() {
    try {
      Query q = pm.newQuery("select from " + Flight.class.getName() + " order by origin.first");
      q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
      q.execute();
      fail("expected exception");
    } catch (JDOFatalUserException e) {
      // good
    }
View Full Code Here

  }

  public void testSortBySubObject_NotEmbeddable() {
    try {
      Query q = pm.newQuery("select from " + HasOneToOneJDO.class.getName() + " order by flight.origin");
      q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
      q.execute();
      fail("expected exception");
    } catch (JDOFatalUserException e) {
      // good
    }
View Full Code Here

  }

  public void testSortByUnknownProperty() {
    try {
      Query q = pm.newQuery("select from " + Flight.class.getName() + " order by dne");
      q.addExtension(DatastoreManager.QUERYEXT_INMEMORY_WHEN_UNSUPPORTED, "false");
      q.execute();
      fail("expected exception");
    } catch (JDOFatalUserException e) {
      // good
    }
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.