@SuppressWarnings("unchecked") boolean imagesContainsInstrument(Session s, List<Long> images, Instrument instr, Map<Long, List<Long>> cache) { if (instr == null) { return false; } Long instrID = instr.getId(); List<Long> imgIDs; if (cache.containsKey(instrID)) { imgIDs = cache.get(instrID); } else { imgIDs = (List<Long>) s .createQuery("select id from Image where instrument.id = ?") .setParameter(0, instrID).list(); cache.put(instrID, imgIDs); } return CollectionUtils.containsAny(images, imgIDs); }
return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(VERSION)) { return getVersion();