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:
parent
54c2586a01
commit
8b181857a6
|
@ -112,7 +112,8 @@ public class CollectionCacheInvalidator
|
||||||
}
|
}
|
||||||
// this is the property this OneToMany relation is mapped by
|
// this is the property this OneToMany relation is mapped by
|
||||||
String mappedBy = collectionPersister.getMappedByProperty();
|
String mappedBy = collectionPersister.getMappedByProperty();
|
||||||
if ( mappedBy != null && !mappedBy.isEmpty() ) {
|
if ( !collectionPersister.isManyToMany() &&
|
||||||
|
mappedBy != null && !mappedBy.isEmpty() ) {
|
||||||
int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
|
int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
|
||||||
Serializable oldId = null;
|
Serializable oldId = null;
|
||||||
if ( oldState != null ) {
|
if ( oldState != null ) {
|
||||||
|
|
Loading…
Reference in New Issue