TransientObjectException - object references an unsaved transient instance - save the transient instance before flushing
NoteItem
references a transient (not yet saved) instance of Note
which has to be saved before. So specify "Cascade.all" on property note or call saveorupdate on Note first.