Skip to content

Commit

Permalink
- ignore shared collections, these are deliberate and there will be n…
Browse files Browse the repository at this point in the history
…o changes within them (same as Alfa change in 5.4.19)

- don't set the type as a side-effect of getType() method on SimpleValue (mimics behaviour of 5.4)
  • Loading branch information
euano committed Aug 20, 2024
1 parent 74b91c3 commit 40d230c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.type.CollectionType;

import org.jboss.logging.Logger;

/**
Expand Down Expand Up @@ -184,9 +183,12 @@ public static void processReachableCollection(
// who set up circular or shared references between/to collections.
if ( ce.isReached() ) {
// We've been here before
throw new HibernateException(
"Found shared references to a collection: " + type.getRole()
);

// Alfa change - ignore shared collections, these are deliberate and there will be no changes within them.
return;
// throw new HibernateException(
// "Found shared references to a collection: " + type.getRole()
// );
}

ce.setReached( true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Objects;
import java.util.Properties;

import javax.persistence.AttributeConverter;

import org.hibernate.FetchMode;
Expand Down Expand Up @@ -515,7 +516,7 @@ public Type getType() throws MappingException {
throw new MappingException( msg );
}

return type = result;
return result;
}

@Override
Expand Down

0 comments on commit 40d230c

Please sign in to comment.