In one-to-man relationship, it is when the father and child relationship are saved at the same time, it will be reported: java.lang.nullpointersRext At com.kaoyanhelper.logic.testhibernate.Main (Testhibernate.java: 39)
Solution:
Base parent.java file: Find private java.util.set _childs;
Haha, actually did not initialize, that is in Parent.getChilds (). Add (child); Can I send an empty pointer error?
Just change to private java.util.set_Childs = new hashset ();
HEHE, of course, import .. Don't forget it.
In addition, everyone has a good way to tell me .. THANKS.