import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class ExportDB {
public static void main(String[] args) {
Configuration configuration=new Configuration().configure();
SchemaExport schemaExport=new SchemaExport(configuration);
schemaExport.create(true, true);
}
}
总结:用此方法用成数据表,对数据库迁移时相当方便!