Package javax.jdo

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


    @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

        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

            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

        } 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

       
         
          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

       
          try {
            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

       
          try {
            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, 6); //only 6 results
            //query.setOrdering("hireDate desc");
View Full Code Here

             PersistenceManager pm = null;
            pm = PMF.get().getPersistenceManager();
           
                try {
              Query query = pm.newQuery(DaoCommunityClan2.class);
                query.setFilter("idClan == nameParam");
                //query.setOrdering("name desc");
                query.setOrdering("dateCommunityClan desc");
                query.setRange(0, 30); //only 30 results
                //query.setOrdering("hireDate desc");
View Full Code Here

           
             PersistenceManager pm = null;
            pm = PMF.get().getPersistenceManager();
           
                try {
              Query query = pm.newQuery(DaoRecruistation.class);
                //query.setFilter("idClan == nameParam");
                //query.setOrdering("name desc");
                query.setOrdering("date desc");
                query.setRange(0, Long.valueOf(nbSave)); //only nbJours 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.