1 import org.hibernate.cfg.Configuration;
 2 import org.hibernate.tool.hbm2ddl.SchemaExport;
 3 
 4 public class CreateHibernateSql {
 5 
 6     public static void main(String[] args) {
 7         Configuration cfg = new Configuration().configure();//默认classpath下的hibernate.cfg.xml
 8         SchemaExport export = new SchemaExport(cfg);
      //是否生成sql语句,是否建表  
9 export.create(true,false); 10 } 11 }

 

相关文章:

  • 2022-12-23
  • 2021-04-11
  • 2021-09-29
  • 2021-10-06
  • 2022-01-06
  • 2021-08-17
  • 2019-01-22
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-02-03
相关资源
相似解决方案