package org.apple.hibernate;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
class UserTest{
public static void main(String[] args) throws Exception{
//配置环境,分析xml映射文件
Configuration conf= new Configuration().addClass(User.class);
//生成并输出sql到文件(当前目录)和数据库
SchemaExport dbExport=new SchemaExport(conf);
dbExport.create(true, true);
}
posted on 2010-06-06 22:55
豪情 阅读(205)
评论(0) 编辑 收藏 所属分类:
Hibernate 3