没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1、已知数据库MyBatisRelation中存在以下几个表: a. 学生(Student):id(int, primary key, auto increment),Name(姓名,varchar),Birthday(出生日期,date),性别(Sex,varchar) b. 学生证(StudentIDCard):id(int, primary key, auto increment),StuNo(学号,long) c. 班级(Class):id(int, primary key, auto increment),Specialty(专业,varchar),Grade(年级,int),Class(班,int) d. 课程(Course):id(int, primary key, auto increment),Name(课程名,varchar) 现建立以下的关联关系:学生与学生证、学生与班级、学生与课程的选课。分别说出这三种关系属于MyBatis关联关系的哪种类型,通过在相应表中添加合适的外键或创建中间表的方式实现这些关联关系,并创建相应的类,实现以下的查询: (1)通过Student表的id查找该学生的信息,并同时获取其学号; (2)通过Class表的id查找某个班级的信息,并同时查找该班级的所有学生信息; (3)通过Student表的id查找该学生的信息,并同时获取其选课信息。 以上每种查询都使用嵌套查询和嵌套结果查询实现。
资源推荐
资源详情
资源评论
收起资源包目录
MyBatis的关联映射.rar (53个子文件)
mybatisrelation.sql 4KB
数据库设计.docx 221KB
fifth
.project 905B
WebContent
WEB-INF
lib
log4j-core-2.3.jar 808KB
cglib-3.2.4.jar 293KB
slf4j-log4j12-1.7.22.jar 10KB
slf4j-api-1.7.22.jar 40KB
ant-launcher-1.9.6.jar 18KB
log4j-1.2.17.jar 478KB
asm-5.1.jar 52KB
javassist-3.21.0-GA.jar 718KB
ant-1.9.6.jar 1.94MB
mysql-connector-java-5.1.40-bin.jar 968KB
commons-logging-1.2.jar 60KB
log4j-api-2.3.jar 133KB
mybatis-3.4.2.jar 1.52MB
ognl-3.1.12.jar 230KB
META-INF
MANIFEST.MF 39B
src
com
itheima
utils
MybatisUtils.java 843B
mapper
CourseMapper.xml 2KB
StudentidcardMapper.xml 406B
StudentMapper.xml 2KB
ClassMapper.xml 2KB
test
MybatisTest.java 2KB
po
Course.java 490B
Class.java 1KB
Studentidcard.java 512B
Student.java 2KB
mybatis-config.xml 2KB
db.properties 151B
log4j.properties 334B
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 305B
org.eclipse.jdt.core.prefs 364B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 467B
.jsdtscope 567B
build
classes
com
itheima
utils
MybatisUtils.class 1KB
mapper
CourseMapper.xml 2KB
StudentidcardMapper.xml 406B
StudentMapper.xml 2KB
ClassMapper.xml 2KB
test
MybatisTest.class 2KB
po
Course.class 1021B
Class.class 2KB
Student.class 3KB
Studentidcard.class 1KB
mybatis-config.xml 2KB
db.properties 151B
log4j.properties 334B
.classpath 2KB
实验.docx 17KB
运行结果图(参照).docx 229KB
共 53 条
- 1
资源评论
qq_38662410
- 粉丝: 6
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功