import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class AutoCreateTable {

	/**
	 * @param args
	 * 该类用来创建数据库表格
	 * 运行该类的时候会根据实体类以及你配置的映射文件来生成数据库表格
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Configuration cfg = new Configuration().configure();
		SchemaExport sex = new SchemaExport(cfg);
		sex.create(true, true);
	}

}

  

 

相关文章:

  • 2021-08-15
  • 2021-09-29
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-08-26
  • 2021-09-03
  • 2021-09-04
  • 2021-12-13
  • 2022-03-07
  • 2021-04-11
相关资源
相似解决方案