我刚刚意识到,当一个对象从Hibernate缓存中被逐出时,dependantcollections,ifcached,havetobeevictedseparately.对我来说,这是一个很大的WTF:很容易忘记驱逐一个集合(例如,当一个新的集合被添加到对象映射时);驱逐依赖集合的代码丑陋且庞大,例如MyClassmyObject=...;getHibernateTemplate().evict(myObject);缓存cache=getHibernateTemplate().getSessionFactory().getCache();cache.evictCollection("