Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.Flight


    @SuppressWarnings("unchecked")
    List<Object[]> results = (List<Object[]>) q.execute();
    assertEquals(1, results.size());
    assertEquals(2, results.get(0).length);
    assertEquals(KeyFactory.keyToString(e1.getKey()), results.get(0)[0]);
    Flight f = pm.getObjectById(Flight.class, e2.getKey());
    List<Flight> flights = (List<Flight>) results.get(0)[1];
    assertEquals(1, flights.size());
    assertEquals(f, flights.get(0));
  }
View Full Code Here


    Entity e = Flight.newFlightEntity("y", "bos", "mia", 23, 24);
    ds.put(null, e);
    commitTxn();
    beginTxn();
    q.setUnique(true);
    Flight f = (Flight) q.execute();
    assertEquals(e.getKey(), KeyFactory.stringToKey(f.getId()));
  }
View Full Code Here

    List<Flight> results = (List<Flight>) q.execute();
    Iterator<Flight> iter = results.iterator();
    iter.next();
    commitTxn();
    pm.close();
    Flight f = iter.next();
    f.getDest();
    iter.next();
  }
View Full Code Here

    Entity parentEntity = new Entity(HasOneToOneJDO.class.getSimpleName());
    ds.put(null, parentEntity);
    Entity flightEntity = newFlightEntity(parentEntity.getKey(), null, "f", "bos", "mia", 2, 4, 33);
    ds.put(null, flightEntity);

    Flight flight = fp.getFlight(flightEntity.getKey());
    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where flight == f parameters " + Flight.class.getName() + " f");
    List<HasOneToOneJDO> result = (List<HasOneToOneJDO>) q.execute(flight);
    assertEquals(1, result.size());
View Full Code Here

    Entity parentEntity = new Entity(HasOneToOneJDO.class.getSimpleName());
    ds.put(null, parentEntity);
    Entity flightEntity = newFlightEntity(parentEntity.getKey(), null, "f", "bos", "mia", 2, 4, 33);
    ds.put(null, flightEntity);

    Flight flight = fp.getFlight(flightEntity.getKey());
    Query q = pm.newQuery(
        "select from " + HasOneToOneJDO.class.getName()
        + " where id == parentId && flight == f "
        + "parameters String parentId, " + Flight.class.getName() + " f");
    List<HasOneToOneJDO> result = (List<HasOneToOneJDO>) q.execute(KeyFactory.keyToString(flightEntity.getKey()), flight);
View Full Code Here

    Entity parentEntity = new Entity(HasOneToOneJDO.class.getSimpleName());
    ds.put(null, parentEntity);
    Entity flightEntity = newFlightEntity(parentEntity.getKey(), null, "f", "bos", "mia", 2, 4, 33);
    ds.put(null, flightEntity);

    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 {
View Full Code Here

    Entity parentEntity = new Entity(HasOneToOneJDO.class.getSimpleName());
    ds.put(null, parentEntity);
    Entity flightEntity = newFlightEntity("f", "bos", "mia", 2, 4, 33);
    ds.put(null, flightEntity);

    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 {
View Full Code Here

    Entity parentEntity = new Entity(HasOneToOneJDO.class.getSimpleName());
    ds.put(null, parentEntity);
    Entity flightEntity = newFlightEntity("f", "bos", "mia", 2, 4, 33);
    ds.put(null, flightEntity);

    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 {
View Full Code Here

    Entity e = newFlightEntity("harold", "bos", "mia", 23, 24, 25);
    ds.put(null, e);
    Query q = pm.newQuery(
        "select from " + Flight.class.getName() + " where you == p parameters Long p");
    q.setUnique(true);
    @SuppressWarnings("unchecked")
    Flight result = (Flight) q.execute(23);
    assertEquals(e.getKey(), KeyFactory.stringToKey(result.getId()));
  }
View Full Code Here

    Query q = pm.newQuery(Flight.class);
    q.setOrdering("you");
    @SuppressWarnings("unchecked")
    List<Flight> results = (List<Flight>) q.execute();
    assertEquals(2, results.size());
    Flight f1 = results.get(0);
    Flight f2 = results.get(1);
    assertEquals(KeyFactory.stringToKey(f2.getId()), e2.getKey());
    assertEquals(KeyFactory.stringToKey(f1.getId()), e1.getKey());
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.Flight

Copyright © 2018 www.massapicom. 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.