2018年7月31日
摘要:
课程链接: 课程简介: 1 什么是框架 2 Spring简介 3 IOC(配置,注解) 4 Bean(配置,注解) 5 AOP(配置,注解,AspectJ、API) SpringFrameWork 常用网站: http://spring.io/ http://spring.io/projects/s
阅读全文
posted @ 2018-07-31 10:19
菜鸟乙
阅读(197)
推荐(0)
2018年7月30日
摘要:
package com.ddwei.test; import org.hibernate.Session; import org.hibernate.Transaction; import com.ddwei.entity.Employee2; import com.ddwei.entity.Project; import com.ddwei.util.HibernateUtil; /**...
阅读全文
posted @ 2018-07-30 17:15
菜鸟乙
阅读(112)
推荐(0)
摘要:
如何通过添加中间表实现多对多? 1 在双方实体中添加一个保存对方的集合。 2 在双方映射文件中 使用<set>和<many-to-many>元素进行关联关系配置(注意此处)
阅读全文
posted @ 2018-07-30 16:47
菜鸟乙
阅读(91)
推荐(0)
摘要:
本节主要内容:配置映射文件 Project.hbm.xml Employee2.hbm.xml
阅读全文
posted @ 2018-07-30 16:39
菜鸟乙
阅读(135)
推荐(0)
摘要:
生成实体类 和 cfg.xml配置 cfg.xml 参照一对多映射 实体类如下: Project 类 Employee2类
阅读全文
posted @ 2018-07-30 16:13
菜鸟乙
阅读(147)
推荐(0)
摘要:
--创建表 -- 创建项目表 create table project( proid int(10) not null comment '项目Id', proname varchar(30) comment '项目名称' ); -- 创建员工表 create table employee2( emp
阅读全文
posted @ 2018-07-30 15:20
菜鸟乙
阅读(129)
推荐(0)
摘要:
1 用途: 员工和项目之间的多对多关系 2 实现: 员工表和项目表之外,建立员工和项目关联表来实现: 3 hibernate应用: set元素和many-to-many来实现
阅读全文
posted @ 2018-07-30 11:34
菜鸟乙
阅读(195)
推荐(0)
摘要:
1 配置 项目右击==》properties==>project facets==>convert to faceted form...复选框选中java 和 jpa==》further configuration available ==>eclipse link 2.5x==>user libr
阅读全文
posted @ 2018-07-30 11:26
菜鸟乙
阅读(137)
推荐(0)
2018年7月27日
摘要:
1 Eclipse新建java项目 2 Windows ==> show view == >other ==>Data source Explorer 3 左侧视图 database Connections ==>右键==》new==>mysql ==>next==>填好数据库相关连接,并引用mys
阅读全文
posted @ 2018-07-27 16:10
菜鸟乙
阅读(134)
推荐(0)
摘要:
1 单方一对多 xml one-to-many 配置 实体类 一方添加保存多方集合 2 单方多对一 xml many-to-one 配置 实体类 多方添加保存一方引用 3 常用属性 inverse:设置哪一方维护关联关系 cascade:设置级联关系
阅读全文
posted @ 2018-07-27 11:25
菜鸟乙
阅读(106)
推荐(0)