static void importAllConceptsOfType(Class cClass, Cl l, O... _) { bool debug = boolPar debug(_); Concepts cc = db_mainConcepts(); Set ids = mapToSet(l, c -> c.id); fOr (A c : l) { A existing = cast cc.getConcept(c.id); if (existing == null) { if (debug) print("import: adding " + c); cc.registerKeepingID(existing = c); } else { if (debug) print("import: updating " + c); copyConceptFields(c, existing); } } for (A c : cloneList(list(cc, cClass))) if (!ids.contains(c.id)) { if (debug) print("import: deleting " + c); deleteConcept(c); } }