Пример #1
0
 private static MultiSnipe cacheResult(MultiSnipe rval) {
   if (rval != null) {
     if (singleSource.get(rval.getId()) != null) {
       rval = singleSource.get(rval.getId());
     } else {
       singleSource.put(rval.getId(), rval);
     }
   }
   return rval;
 }
Пример #2
0
  public static boolean deleteAll(List<MultiSnipe> toDelete) {
    if (toDelete.isEmpty()) return true;
    String multisnipes = makeCommaList(toDelete);

    for (MultiSnipe ms : toDelete) {
      singleSource.remove(ms.getId());
    }

    return toDelete.get(0).getDatabase().deleteBy("id IN (" + multisnipes + ")");
  }