Hibernate_ExportDB

Auto Create Table Code:


import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

/**
 * 
 * @author skyqiang
 *
 */
public class ExportDB {
	public static void main(String[] args) {
		
		//read configuration file
		Configuration config = new Configuration();
		
		//create SchemaExport object
		SchemaExport export = new SchemaExport(config);
		
		//create table of database
		export.create(true, true);
		
	}
	
}

你可能感兴趣的:(java,Hibernate)