private PersistentCollection<?> duplicatePersistentCollection(MergeContext mergeContext, Object coll, Object parent, String propertyName) { if (!(coll instanceof PersistentCollection)) throw new RuntimeException("Not a persistent collection/map " + ObjectUtil.toString(coll)); PersistentCollection<?> ccoll = ((PersistentCollection<?>)coll).clone(mergeContext.isUninitializing()); if (mergeContext.isUninitializing() && parent != null && propertyName != null) { if (dataManager.hasVersionProperty(parent) && dataManager.getVersion(parent) != null && dataManager.isLazyProperty(parent, propertyName)) ccoll.uninitialize(); } return ccoll; }
((PersistentCollection<Set<?>>)previous).uninitialize();
((PersistentCollection<Map<?, ?>>)previous).uninitialize();
((PersistentCollection<List<?>>)previous).uninitialize();
if (mergeContext.isUninitializeAllowed() && mergeContext.hasVersionChanged(parent)) { log.debug("uninitialize lazy collection %s", ObjectUtil.toString(previous)); ((PersistentCollection<?>)previous).uninitialize();