We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fab9834 commit 84cc5f0Copy full SHA for 84cc5f0
hibernate-core/src/main/java/org/hibernate/type/CollectionType.java
@@ -631,6 +631,14 @@ public Object replace(
631
final Object owner,
632
final Map<Object, Object> copyCache) throws HibernateException {
633
if ( original == null ) {
634
+ if ( target == null ) {
635
+ return null;
636
+ }
637
+ if ( target instanceof PersistentCollection ) {
638
+ final Collection collection = (Collection) target;
639
+ collection.clear();
640
+ return collection;
641
642
return null;
643
}
644
if ( !Hibernate.isInitialized( original ) ) {
0 commit comments