@Override public void delete(Long scheduleId, Long id) { super.delete(scheduleId, id); Object entityCacheKey = getEntityCacheKey(Job.class, getJobWideUniqueData(scheduleId, id)); cache.remove(entityCacheKey); abandonScheduleCache(scheduleId); }
@SuppressWarnings("unchecked") @Override public void update(Job job, boolean commitAfter) { super.update(job, commitAfter); Object entityCacheKey = getEntityCacheKey(Job.class, getJobWideUniqueData(job.getKey())); Job cachedJob = (Job) cache.get(entityCacheKey); if (cachedJob != null) { if (!cachedJob.getCronString().equals(job.getCronString())) { abandonJobsByCronStringCache(cachedJob.getCronString()); abandonJobsByCronStringCache(job.getCronString()); } cache.put(entityCacheKey, job); } else { abandonJobsByCronStringCache(); } updateJobInScheduleCache(job); }