I can now reproduce it with a test in Hibernate OGM, I've fixed it for MongoDB but it seems there are other issue with the other dialects