摘要: 复合主键(联合主键):多个字段构成唯一性。一,xml方式1. 将联合主键的属性提取出来,重新编写一个StudentPK类(原Student类中的id,name要删除 并新加入属性“StudentPK”)//StudentPK .javapackage com.bjsxt.hibernate;publ... 阅读全文
posted @ 2014-12-02 21:40 enjoy_clh 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 一,xml生成ida) generator b) 常用四个:native identity sequence uuid(跨平台 nat... 阅读全文
posted @ 2014-12-02 20:24 enjoy_clh 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 一.hibernate.cfg.xml: hbni2ddl.auto 二.搭建日志环境并配置显示DDL语句我们使用slf接口,然后使用log4j的实现。1、首先引入log4j的jar包(log4j-1.2.14.jar),2、然后再引入slf4j实现LOG4J和适配器jar包(slf4j-log4j... 阅读全文
posted @ 2014-12-02 13:27 enjoy_clh 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 一,Hibernate结构图二,HelloWorld1,建立hebernate配置文件hibernate.cfg.xml com.mysql.jdbc.Driver jdbc:mysql://localhost/hibernate r... 阅读全文
posted @ 2014-12-02 09:10 enjoy_clh 阅读(205) 评论(0) 推荐(0) 编辑