thanks Ralf, so this isnt a bug, the weird thing is with hibernate 5.6 was working.
finally, the only way is refactor the code?