Examples of newQuery()


Examples of javax.jdo.PersistenceManager.newQuery()

          //bad number
          return;
        }
       
        //find sub
        Query q = pm.newQuery(Subscription.class);
        q.setFilter("userKey == k");
        q.declareParameters("com.google.appengine.api.datastore.Key k");
       
        @SuppressWarnings("unchecked")
        List<Subscription> subs = (List<Subscription>) q.execute(u.getKey());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();
   
    User user = dm.getUserFromId(pm , jid);
   
    Query q = pm.newQuery(Subscription.class);
    q.setFilter("userKey == uk");
    q.declareParameters("com.google.appengine.api.datastore.Key uk");
   
    @SuppressWarnings("unchecked")
    List<Subscription> list = (List<Subscription>) q.execute(user.getKey());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    if (jid != null){
      DataManager dm = DataManagerFactory.getInstance();
      PersistenceManager pm = dm.newPersistenceManager();
     
      //fetch user
      Query quser = pm.newQuery(User.class);
      quser.setFilter("id == jid");
      quser.declareParameters("java.lang.String jid");
      quser.setUnique(true);
     
      User user = (User) quser.execute(jid);
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

     
      User user = (User) quser.execute(jid);
     
      if (user != null){
        //fetch all subscriptions
        Query q = pm.newQuery(Subscription.class);
        q.setFilter("userKey == key");
        q.declareParameters("com.google.appengine.api.datastore.Key key");
       
        @SuppressWarnings("unchecked")
        List<Subscription> list = (List<Subscription>) q.execute(user.getKey());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    PersistenceManager pm = dm.newPersistenceManager();
   
    //fetch user
    User u = dm.getUserFromId(pm , id);
   
    Query q = pm.newQuery(Subscription.class);
    q.setFilter("userKey == k");
    q.declareParameters("com.google.appengine.api.datastore.Key k");
   
    @SuppressWarnings("unchecked")
    List<Subscription> subs = (List<Subscription>) q.execute(u.getKey());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

    @SuppressWarnings("unchecked")
    public List<Photo> queryPhotos() {
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
            String queryStr = String.format("select from %s where user_email==currentUser order by modification desc", Photo.class.getName());
            Query query = pm.newQuery(queryStr);
            query.declareParameters("String currentUser");
            List<Photo> photos = (List<Photo>) query.execute(getUserEmail());
            if (photos.size() == 0) {
                photos.size();
            }
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

        if (action.equalsIgnoreCase("flushTokens")) {
          PersistenceManager pm = PMF.get().getPersistenceManager();
          try {
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.HOUR, -6);
            Query query = pm.newQuery(AuthenticationToken.class);
            query.setFilter("activity < activityParam");
            query.setRange(0, 1000);
            query.declareImports("import java.util.Date");
            query.declareParameters("Date activityParam");
            List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute(cal.getTime());
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

            pm.close();
          }
        } else if (action.equalsIgnoreCase("countTokens")) {
          PersistenceManager pm = PMF.get().getPersistenceManager();
          try {
            Query query = pm.newQuery(AuthenticationToken.class);
              List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute();
              int c = objs.size();
              String msg = user + " - There are " + c + " tokens.";
              log.log(Level.INFO, msg);
              resp.getWriter().write(msg);
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

        } else if (action.equalsIgnoreCase("countFlushTokens")) {
          PersistenceManager pm = PMF.get().getPersistenceManager();
          try {
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.HOUR, -6);
            Query query = pm.newQuery(AuthenticationToken.class);
            query.setFilter("activity < activityParam");
            query.declareImports("import java.util.Date");
            query.declareParameters("Date activityParam");
            List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute(cal.getTime());
            int c = objs.size();
View Full Code Here

Examples of javax.jdo.PersistenceManager.newQuery()

       
         
          for (String user  : listIdUsers) {
          /// query
        Query query = pm.newQuery(DaoCommunityAccount2.class);
          query.setFilter("idUser == nameParam");
          query.setOrdering("name desc");
          query.setOrdering("dateCommunityAccount desc");
          query.setRange(0, range); //only 6 results
          //query.setOrdering("hireDate desc");
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.