コード例 #1
0
 public static void deleteAllAccesses(List<Access> list) {
   PersistenceManager pm = PMF.get().getPersistenceManager();
   try {
     pm.deletePersistentAll(list);
   } finally {
     pm.close();
   }
 }
コード例 #2
0
  private void deleteToken(String screenName, User user) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Query query = pm.newQuery(TwitterAccount.class);
    query.setFilter("twitterScreenName == screenVar && user == userVar");
    query.declareParameters("String screenVar,  com.google.appengine.api.users.User userVar");
    @SuppressWarnings("unchecked")
    List<TwitterAccount> twitterAccounts = (List<TwitterAccount>) query.execute(screenName, user);
    pm.deletePersistentAll(twitterAccounts);
    query.closeAll();

    query = pm.newQuery(TwitterStatus.class);
    query.setFilter("twitterScreenName == screenVar && user == userVar");
    query.declareParameters("String screenVar,  com.google.appengine.api.users.User userVar");
    @SuppressWarnings("unchecked")
    List<TwitterStatus> twitterStatus = (List<TwitterStatus>) query.execute(screenName, user);
    pm.deletePersistentAll(twitterStatus);

    // TODO delete all related transactions

    query.closeAll();
    pm.close();
  }
コード例 #3
0
  @Override
  public void deleteAll() {
    PersistenceManager pm = getPersistenceManager();

    pm.deletePersistentAll(findAll());
  }