Package javax.jdo

Examples of javax.jdo.PersistenceManager.newQuery()


  public static Collection<Unit> unitsHomeless(Event event)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    // Get the list of village mappings in place for this event
    Query query = pm.newQuery(Unit.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    query.setFilter("villageKey == null");
   
    return queryDetachAndClose(Unit.class, query, false);
View Full Code Here


 
  public static Unit unitByName(String unitName, Key orgKey, Key ignoreKey)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Unit.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
   
    if (ignoreKey == null)
    {
      query.setFilter("name == nameParam && organisationKey == organisationKeyParam");
View Full Code Here

 
  public static Collection<Booking> allBookings(boolean validOnly)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class)
    if (validOnly)
      query.setFilter("cancellationDate == null");
    return queryDetachAndClose(Booking.class, query, true);
  }
 
View Full Code Here

 
  public static Collection<Booking> bookingsForUnit(Unit unit, Event event)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setOrdering("name");
    query.setFilter("unitKey == unitKeyParam && eventKey == eventKeyParam");
    query.declareParameters("Key unitKeyParam, Key eventKeyParam");
   
View Full Code Here

 
  public static Collection<Booking> bookingsForUnitAllEvents(Unit unit)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setOrdering("name");
    query.setFilter("unitKey == unitKeyParam");
    query.declareParameters("Key unitKeyParam");
   
View Full Code Here

  {
    Collection<Key> keysForOrg = CollectionUtils.collect(unitsForOrg(org.getKey(), false, true), new KeyBasedData.ToKey());
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key; import java.util.Collection");
    query.setOrdering("name");
    query.setFilter("unitKeysParam.contains(unitKey) && eventKey == eventKeyParam");
    query.declareParameters("Collection unitKeysParam, Key eventKeyParam");
   
View Full Code Here

  {
    if (village == null) throw new IllegalArgumentException("Cannot retrieve booking for a null village. To find homeless bookings, call bookingsHomeless() instead.");
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setOrdering("name");
    query.setFilter("villageKey == villageKeyParam");
    query.declareParameters("Key villageKeyParam");
   
View Full Code Here

  {
    if (event == null) throw new IllegalArgumentException("Cannot retrieve homeless bookings for a null event.");
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setOrdering("name");
    query.setFilter("eventKey == eventKeyParam && villageKey == null");
    query.declareParameters("Key eventKeyParam");
   
View Full Code Here

  {
    if (event == null) throw new IllegalArgumentException("Cannot retrieve bookings for a null event.");
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setOrdering("name");
    query.setFilter("eventKey == eventKeyParam");
    query.declareParameters("Key eventKeyParam");
   
View Full Code Here

  {
    if (eventKey == null) throw new IllegalArgumentException("Cannot retrieve bookings for an empty event.");
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Booking.class);
    query.declareImports("import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.Email");
    query.setOrdering("name");
    query.setFilter("eventKey == eventKeyParam && email == emailParam");
    query.declareParameters("Key eventKeyParam, Email emailParam");
   
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.