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 + ")"); }
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; }
public static MultiSnipe loadFromXML(XMLElement curElement) { String identifier = curElement.getProperty("ID"); String bgColor = curElement.getProperty("COLOR"); Currency defaultSnipe = Currency.getCurrency(curElement.getProperty("DEFAULT")); boolean subtractShipping = curElement.getProperty("SUBTRACTSHIPPING", "false").equals("true"); MultiSnipe ms = MultiSnipe.findFirstBy("identifier", identifier); if (ms == null) ms = new MultiSnipe(bgColor, defaultSnipe, Long.parseLong(identifier), subtractShipping); return ms; }