scene:
Floor entity has dormitories (Set) field,Dormitory entity has student (Set) field,when I import them from an excel table and batch save students use hibernate ,the struct of the excel table like that
![](https://img.haomeiwen.com/i9620224/12f84c35075e4df7.png)
Clearly there is no 'floor.ID' or 'dormitory.ID' field in the table,so hibernate will insert a new floor entity into database=-=.and then---->
![](https://img.haomeiwen.com/i9620224/50137281191e8a3c.png)
solution:
After I get student entity I query the
网友评论