Hi all,
After activating the "hibernate.cache.auto_evict_collection_cache" property, I am getting this error on saving entities updates.
Quote:
org.hibernate.HibernateException: Unable to resolve property:
at org.hibernate.tuple.entity.EntityMetamodel.getPropertyIndex(EntityMetamodel.java:1215)
at org.hibernate.cache.internal.CollectionCacheInvalidator.evictCache(CollectionCacheInvalidator.java:130)
at org.hibernate.cache.internal.CollectionCacheInvalidator.onPostInsert(CollectionCacheInvalidator.java:80)
at org.hibernate.action.internal.EntityInsertAction.postInsert(EntityInsertAction.java:177)
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:145)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:349)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
I think that the problem is when checking for the mappedBy property on a collection persister: when empty, It returns an empty string instead of null.
The error is thrown by the following lines in
org.hibernate.cache.internal.CollectionCacheInvalidator.java:
Code:
// this is the property this OneToMany relation is mapped by
String mappedBy = collectionPersister.getMappedByProperty();
if ( mappedBy != null ) {
int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
...
}
Is this an Hibernate issue ?
Thank you.
Note: I am using Hibernate 4.3.5.Final with JPA 2.1.