日期:2014-05-16  浏览次数:20399 次

由hbm文件生成对应的数据库文件
其实很简单:

import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class HH {   
	public static void main(String[] args) { 
		Configuration config = new Configuration().configure();    
		System.out.println("Creating tables...");     
		SchemaExport schemaExport = new SchemaExport(config);       
        schemaExport.create(true, true);  
          }
	}