我想使用hibernate和java通过代码firt方法生成数据库。我已经成功生成了数据库,但是错过了迁移文件。是否对诸如.NEt中的EntityFrameworkCore,PHP中的Eloquent或节点中的Sequelize之类的迁移提供了休眠支持?
这是我的生成数据库的类:
public class CreateDataBase {
public static void main(String[] args) {
Configuration conf = new Configuration();
conf.configure();
SchemaExport se = new SchemaExport(conf);
se.create(true, true);
}
}
这是我的模式:
package Infra.HibernateConfiguration;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Bank {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@Column()
private String code;
@Column()
private String name;
public int getId() {
return id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}