Package javax.jdo

Examples of javax.jdo.PersistenceManager.deletePersistent()


          blogs.add(b);

        } catch (JDOObjectNotFoundException ex) {
          // blog deleted ! bad !!
          pm.currentTransaction().begin();
          pm.deletePersistent(sub);
          pm.currentTransaction().commit();
          pm.flush();
          continue;
        }
      }
View Full Code Here


      List<Subscription> ls = (List<Subscription>) sq.execute(b.getKey());
     
      if (ls.size() == 0){
        //delete blog without subscription
        pm.currentTransaction().begin();
        pm.deletePersistent(b);
        pm.currentTransaction().commit();
        nb++;
      }
    }
   
View Full Code Here

    @SuppressWarnings("unchecked")
    List<BlogEntry> oldest = (List<BlogEntry>) q.execute(cdat.getTime());
   
    for(BlogEntry be : oldest){
      pm.currentTransaction().begin();
      pm.deletePersistent(be);
      pm.currentTransaction().commit();
      nb++;
    }

    pm.close();
View Full Code Here

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

    Subscription s = pm.getObjectById(Subscription.class, new Long(id));
    pm.currentTransaction().begin();
    pm.deletePersistent(s);
    pm.currentTransaction().commit();
    pm.flush();

    pm.close();
View Full Code Here

    List<Subscription> list = (List<Subscription>) q.execute(user.getKey(),
        blog.getKey());

    if (list.size() > 0) {
      pm.currentTransaction().begin();
      pm.deletePersistent(list.get(0));
      pm.currentTransaction().commit();
      pm.flush();

    }
    q.closeAll();
View Full Code Here

    }
   
    public void deletePhoto(Photo photo) {
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
            pm.deletePersistent(photo);
        } finally {
            pm.close();
        }
    }
   
View Full Code Here

            query.declareImports("import java.util.Date");
            query.declareParameters("Date activityParam");
            List<AuthenticationToken> objs = (List<AuthenticationToken>) query.execute(cal.getTime());
              long c = objs.size();
              for (AuthenticationToken obj : objs) {
              pm.deletePersistent(obj);
              }
              String msg = user + " - Flushed " + c + " tokens.";
              log.log(Level.INFO, msg);
              resp.getWriter().write(msg);
          } finally {
View Full Code Here

    public static void clearUserToken(String email) {
      PersistenceManager pm = PMF.get().getPersistenceManager();
      AuthenticationToken token = null;
      try {
        token = pm.getObjectById(AuthenticationToken.class, email);
        pm.deletePersistent(token);
      }
      catch (JDOObjectNotFoundException e) { }
      finally {
        pm.close();
      }
View Full Code Here

                    pm.currentTransaction().begin();
                    //
                    //log.warning(myDaoCommunityAccount2.getDateCommunityAccount().toString());
                    //
                    if (myDaoCommunityAccount2.getData() != null && myDaoCommunityAccount2.getData().getStats() != null) {
                      pm.deletePersistent(myDaoCommunityAccount2.getData().getStats());
                      pm.deletePersistent(myDaoCommunityAccount2.getData());
                    }
                    pm.deletePersistent(myDaoCommunityAccount2);
                    pm.currentTransaction().commit();
                  }
View Full Code Here

                    //
                    //log.warning(myDaoCommunityAccount2.getDateCommunityAccount().toString());
                    //
                    if (myDaoCommunityAccount2.getData() != null && myDaoCommunityAccount2.getData().getStats() != null) {
                      pm.deletePersistent(myDaoCommunityAccount2.getData().getStats());
                      pm.deletePersistent(myDaoCommunityAccount2.getData());
                    }
                    pm.deletePersistent(myDaoCommunityAccount2);
                    pm.currentTransaction().commit();
                  }
             }
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.