ITeye博客

Hibernate学习日记1

wzw00001 · 2008-02-20 16:28 · hibernate · Markdown

利用hibernat包:实体类,配置文件可以在数据库创建表

package com.bjsxt.hibernate;

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

public class ExportDB {

	public static void main(String[] args) {
		
		//读取配置文件	
		Configuration cfg = new Configuration().configure();
		
		//创建SchemaExport对象
		SchemaExport export = new SchemaExport(cfg);
		
		//创建数据库表
		export.create(true,true);
	}

}

get和load的区别? GET马上加载 LOAD迟延加载!!

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。