jpa - Hibernate Annotations self referencing class? -


I defined this unit class, but this database does not seem to save the children. any idea? @ Entity Folk Category classifies the model model & lt; Category Model & gt; SerialJabal {Personal Stable Last Long Serial UID = -4520507504770029807L; @ Id @ field (index = index.UNT, store = store.no) private string id; Name of the @notational private string; @ManyToOne private classmodel parents; @OneToMany (cascade = cascade type .all, mapped = "parent") private list & lt; Category Modell & gt; children; Public listing & lt; Category Modell & gt; Meet (children); } Public string getId () {return ID; } Public string getName () {return name; } Public Category Model Pattern () {Back Parents; } Public Zero Set Children (List & lt; Class Model & gt; Children) {this.children = Children; } Public Zero Set ID (string id) {this.id = id; } Public Zero Setname (string name) {this.name = name; } Public Zero Setpants (classmodel origins) {This original = parent; }}

Many thanks, Finer

This is the reason The reverse union never prevails; I can tell that the reverse association due to the "mapped" feature is

Comments