Hi,
We are trying to migrate to Hibernate 6.5 and as part of this we have changed the implementation from using Sessions to EntityManagers.
Previously while inserting a record we were using the Session class’ save method as follows -
session.save(entityName, object);
Where object was an implementation of HibernateProxy. It was working fine.
Now, in Hibernate 6 we are using EntityManager’s persist method to accomplish the same task as follows -
entityManager.persist(object);
And here as well the type of object is an implementation of HibernateProxy itself
But we are seeing this exception -
org.hibernate.HibernateException: Could not determine type of dynamic map entity
at org.hibernate.metamodel.internal.EntityInstantiatorDynamicMap.extractEmbeddedEntityName(EntityInstantiatorDynamicMap.java:72)
at org.hibernate.metamodel.internal.EntityInstantiatorDynamicMap.lambda$static$0(EntityInstantiatorDynamicMap.java:59)
at org.hibernate.internal.CoordinatingEntityNameResolver.resolveEntityName(CoordinatingEntityNameResolver.java:35)
at org.hibernate.internal.SessionImpl.guessEntityName(SessionImpl.java:1805)
at org.hibernate.internal.SessionImpl.bestGuessEntityName(SessionImpl.java:1756)
at org.hibernate.event.internal.DefaultPersistEventListener.entityName(DefaultPersistEventListener.java:142)
at org.hibernate.event.internal.DefaultPersistEventListener.persist(DefaultPersistEventListener.java:84)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:77)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:54)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:757)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:741)
Is there any change in behaviour w.r.t saving / persisting the object in Hibernate 6?