if (associated == null) {continue;}
Class<?> associatedClazz = associated.getClass();
Method idGetter = associatedClazz.getDeclaredMethod("getId");
EntityManagerFactory emf = em.getEntityManagerFactory();
Cache emfCache = emf.getCache();
emfCache.evict(associated.getClass(), idGetter.invoke(associated));
} catch (Exception e) {
log.warn("Error", e);
}
}