Examples of newQuery()


Examples of javax.jdo.PersistenceManager.newQuery()

  public ModelAndView ajaxLastEntries(long blogId) {
    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();

    // select subscriptions
    Query q = pm.newQuery(BlogEntry.class);
    q.setOrdering("pubDate desc");
    q.setRange(0, 15);

    q.setFilter("blogKey == bk");
    q.declareParameters("com.google.appengine.api.datastore.Key bk");
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

   
    DataManager dm = DataManagerFactory.getInstance();
   
    PersistenceManager pm = dm.newPersistenceManager();
   
    Query q = pm.newQuery(Blog.class);
   
    //fetch ALL blogs
    @SuppressWarnings("unchecked")
    List<Blog> allBlogs = (List<Blog>) q.execute();
   
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    @SuppressWarnings("unchecked")
    List<Blog> allBlogs = (List<Blog>) q.execute();
   
    for(Blog b : allBlogs){
      //fetch sub
      Query sq = pm.newQuery(Subscription.class);
      sq.setFilter("blogKey == bk");
      sq.declareParameters("com.google.appengine.api.datastore.Key bk");
      sq.setRange(0, 1);
     
      @SuppressWarnings("unchecked")
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

   
    DataManager dm = DataManagerFactory.getInstance();
   
    PersistenceManager pm = dm.newPersistenceManager();
   
    Query q = pm.newQuery(BlogEntry.class);
    q.setFilter("creaDate < date");
    q.setRange(0,50);
    q.declareParameters("java.util.Date date");
   
    Calendar cdat = Calendar.getInstance();
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    PersistenceManager pm = DataManagerFactory.getInstance()
        .newPersistenceManager();


    // find user
    Query q = pm.newQuery(User.class);
    q.setFilter("nextUpdate <= next && paused == false && presence == 'available'");
    q.setOrdering("nextUpdate");
    q.declareParameters("java.util.Date next");
    q.setRange(0, nbMax);
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    email = TextTools.cleanJID(email);
   
    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();

    Query qUser = pm.newQuery(User.class);
    qUser.setFilter("id == email");
    qUser.declareParameters("String email");
    qUser.setRange(0, 1);
    qUser.setUnique(true);
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

      return false;
    }

    Blog blog = pm.getObjectById(Blog.class, new Long(blogId));

    Query q = pm.newQuery(Subscription.class);
    q.setFilter("userKey == uid && blogKey == bid");
    q.declareParameters("com.google.appengine.api.datastore.Key uid, com.google.appengine.api.datastore.Key bid");
    q.setRange(0, 1);

    @SuppressWarnings("unchecked")
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    email.append(user.getLastEmail());
    email.append("\r\n\r\n");
   
    //retrieve subscriptions
    //fetch sub
    Query sq = pm.newQuery(Subscription.class);
    sq.setFilter("userKey == uk && lastDate > date");
    sq.declareParameters("com.google.appengine.api.datastore.Key uk, java.util.Date date");
   
    @SuppressWarnings("unchecked")
    List<Subscription> ls = (List<Subscription>) sq.execute(user.getKey(),user.getLastEmail());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    List<Subscription> ls = (List<Subscription>) sq.execute(user.getKey(),user.getLastEmail());
   
    //fetch new subscriptions
    for(Subscription sub : ls){
      //fetch entries
      Query qEntry = pm.newQuery(BlogEntry.class);
      qEntry.setFilter("blogKey == bk && pubDate > date");
      qEntry.declareParameters("com.google.appengine.api.datastore.Key bk, java.util.Date date");
     
      //fetch entries
      List<BlogEntry> entries = (List<BlogEntry>) qEntry.execute(sub.getBlogKey(),user.getLastEmail());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

   
    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();
   
    //find blogs where "nextUpdate" is before now, ordered by "nextUpdate" date
    Query q = pm.newQuery(Blog.class);
    q.setRange(0, nbMax);
    q.setFilter("nextUpdate <= date");
    q.declareParameters("java.util.Date date");
    q.setOrdering("nextUpdate");
   
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.