@Override public void shots(List<DeviceIcmpPing> list) { if (list != null && list.size() > 0) { List<DeviceIcmpPing> os = new ArrayList<DeviceIcmpPing>(); for (DeviceIcmpPing entity : list) { if (entity.getDevice() != null && entity.getDevice().getId() != null) { os.add(entity); } } if (os.size() > 0) { dao.buildShots(os); } } }
@Override public void save(List<DeviceIcmpPing> list) { if (list != null && list.size() > 0) { List<DeviceIcmpPing> os = new ArrayList<DeviceIcmpPing>(); for (DeviceIcmpPing entity : list) { if (entity.getDevice() != null && entity.getDevice().getId() != null) { entity.setId(idGenerator.generate()); os.add(entity); } } if (os.size() > 0) { dao.batchInsert(os); } } }