Hibernate: ids for this class must be manually assigned before calling save()

前端 未结 2 2031
青春惊慌失措
青春惊慌失措 2021-02-01 12:33

I am having some problems with Hibernate and the oneToMany mapping.

Here is my function:

        Location location = new Location();
                


        
2条回答
  •  逝去的感伤
    2021-02-01 13:22

    your id attribute is not set. this MAY be due to the fact that the DB field is not set to auto increment? what DB are you using? MySQL? is your field set to AUTO INCREMENT?

提交回复
热议问题