【发布时间】:2013-12-10 06:24:44
【问题描述】:
我有一个像这样的简单类
public class IdClass
{
private static final long serialVersionUID = 4594459221202802623L;
private Integer id;
public IdClass(){}
public IdClass(Integer id){super();this.id = id;}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "ID", unique = true, nullable = false)
public Integer getId(){return this.id;}
public void setId(Integer id){this.id = id;}
}
其中有autoIncrement in MYSQL table 一切正常,但我们需要删除表中的所有记录以便稍后重新开始删除我想知道是否可以将 ID 设置为再次从 0 或 1 开始...非常感谢..
【问题讨论】:
-
您可能必须删除整个表才能执行此操作。
标签: java mysql hibernate auto-increment identity