单表 hibernate annotation 形式一对多多对一映射

单表 hibernate annotation 方式一对多多对一映射各位朋友向各位求教一个问题:我使用annotation 方式的hib

单表 hibernate annotation 方式一对多多对一映射
各位朋友向各位求教一个问题:我使用annotation 方式的hibernate映射配置,做一个单表关联的实体类。
有如下关系:
id name parentId
1  first null
2  second 1
3  three  1
4  four   2

是一个树的结构,也就是表本身的一对多,多对一的关系。配置了半天总是出错。谢谢!