You can use the persist() method rather than save().
https://forum.hibernate.org/viewtopic.php?f=1&t=1011405
However, unlike save(), persist() does not guarantee that the identifier value will be set immediately on the persisted instance.
https://forum.hibernate.org/viewtopic.php?f=1&t=951275
(and you can jump to christian’s last post in the thread)