hibernate 的注意事项

Hibernate 基础配置

1:对应项目:Hibernate_0300_BasicConfiguration
2:介绍mysql 的图形化客户端
3: hibernate .cfg.xml : hbm2ddl.auto
a):先见表还是 先建 实体类

4:搭建日志环境并 配置显示DDL 语句
5: 搭建 junit 环境
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:不需要 psersistece的字段
a; Annitatio@ Transient

 

posted @ 2016-03-25 18:28  菜渣  阅读(245)  评论(0编辑  收藏  举报