I believe, you instruct hibernate to generate the id for you, then why are you trying to pass the value for it.
That might be the reason. I assume, you are worried about knowing the value hibernate is gonna generate for you. If thats the case, your save method would return the generated key for you to use further.