HHH-10593 - Avoid NullPointerException with auto_evict_collection_cache and many-to-many

Added verification to many-to-many relation
This commit is contained in:
Janario Oliveira 2016-03-05 22:46:24 -03:00 committed by Vlad Mihalcea
parent afa37ab085
commit 29b8f6519c
1 changed files with 2 additions and 1 deletions

View File

@ -112,7 +112,8 @@ public class CollectionCacheInvalidator
}
// this is the property this OneToMany relation is mapped by
String mappedBy = collectionPersister.getMappedByProperty();
if ( mappedBy != null && !mappedBy.isEmpty() ) {
if ( !collectionPersister.isManyToMany() &&
mappedBy != null && !mappedBy.isEmpty() ) {
int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
Serializable oldId = null;
if ( oldState != null ) {