总结与提纲

1、对应项目:Hibernate_0300_BasicConfiguration
2、介绍MySQL的图形化客户端
3、hibernate.cfg.xml:hbm2ddl.auto
  a)先建表还是先建实体类
4、搭建日志环境并配置显示DDL语句
5、搭建JNnit环境
  a)需要注意JUnit的Bug
6、hibernate.cfg.xml:show_sql
7、hibernate.cfg.xml:format_sql
8、表名和类名不同,对表名进行配置
  a) Annotation:@Table
  b) xml:自己查询
9、字段名和属性相同
  a) 默认为@Basic
  b) xml中不用写column
10、字段名和属性名不同
  a) Annotation:@Column
  b) xml:自己查询
11、不需要persistence的字段
  a) Annotation:@Transient
  b) xml不写
12、映射日期与时间类型,指定时间精度
  a) Annotation:@Temporal
  b) xml:指定 type
13、映射枚举类型
  a) @Enumerated
  b) xml:麻烦
14、字段映射的位置(field或者)
  a) best practice:保持field和 get set 方法的一致
15、@Lob
16、课外:CLOB BLOB类型的数据存取
17、课外:Hibernate 自定义数据类型
18、hibernate类型

原文地址:https://www.cnblogs.com/ShawnYang/p/6693288.html