公共类客户{
private static int count = 1;
public Customer(String x,String y) {
super();
this.x = new Simple-String-Property(x);
this.y = new Simple-String-Property(y);
this.id = new Simple-Integer-Property(count);
count++;
}
我有一个抽象表,该表在应用程序启动后从数据库填充数据。所以我希望我的id列在检索数据后自动递增。所以我使用变量计数为静态,它工作正常。但是,当我将抽象数据提交到表时,即使表上的数据根据所填充的数据库显示不同的数字,ID列也将返回1。