springboot报错---No identifier specified for entity: com.example.demo.entity.User

No identifier specified for entity: com.example.demo.entity.User
error content is as follows:
because JPA lacks @id

Insert picture description here
Solution:
add the content as shown in the figure:

import javax.persistence.Id;
@id

Insert picture description here
Just run it again.Insert picture description here

There are many fan-exclusive files, tutorials and source codes in the personal files

Guess you like

Origin blog.csdn.net/weixin_44182157/article/details/108942886