---
title: "Hibernate学习日记1"
author: "wzw00001"
date: "2008-02-20T16:28:58Z"
tags: []
slug: "hibernate-1"
draft: false
lastmod: "2008-02-20T16:28:58Z"
id: 163664
url: "https://jetwu.iteye.com/blog/163664"
---

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

```java
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迟延加载!!