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; }