Well, Hibernate rightfully complains about parent_id being null because H does not-null check before persisting an object.
Is there a problem to use ‘assigned’ IDs – it is slightly less convenient but perhaps will help to avoid this problem.
As a side note: it looks like you are trying to let Hibernate to take care of entire tree structure. I do not think this is a good idea. I suggest looking at ‘nested set’ tree model from Joe Celko’s SQL for Smarties (and I definitely recommend the book)
http://www.dbmsmag.com/9603d06.html
That model is really much more convenient to deal with in RDBMS, especially for hierarchical and roll-up queries.