@Id @GeneratedValue(strategy=GenerationType.AUTO)

来源:百度知道 编辑:UC知道 时间:2024/05/28 02:08:24
请问这句命令用途是什么?

这个是JPA
这句下面应该有个getId方法吧?
象这样
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public String getId() {
return id;
}

这是说Id是个自增主键,映射到你这个类中的String id