In Hibernate 5.6.14, calling entityManager.merge(entity) with a transient entity retains entity.id = null after the call.
After migration to Hibernate 6.3.1, the same call seems to modify the entity and sets id to a generated value.
I cannot find any clues in docs for why this has been changed.
In our case, it breaks our existing code after migration, since we interpret a non-null id to indicate that the entity has been persisted and a null id indicating it is a new entity (in which we perform additional logic).