记录一次 hibernate 映射实体报错:No identifier specified for entity: com.xxxx.modules.fsmanage.domain.FileSnapshot
上错误:
org.hibernate.AnnotationException:
No identifier specified for entity: com.xxxx.xxx.xxx
新添加了一个实体类,报以上错误。原因是我添加的@Id注解导入的包有误,
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
import org.springframework.data.annotation.Id;
删除这一行代码就ok啦!