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 54c2586a01
commit 8b181857a6
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 ) {