hibernate自动建表java代码

package cn.com.songjy.sh.util;

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


public class AutoCreateTable {
	public static void main(String[] args){
		Configuration cfg = new Configuration().configure();
		SchemaExport se = new SchemaExport(cfg);
		se.create(true, true);
	}
}

你可能感兴趣的:(Hibernate,Java代码,自动建表)