Get generated entity Id before persisting, Hibernate, Spring data

Solution 1:

You can't; the act of persisting itself is what creates the ID.