MyBatis的关联映射

上传者: 38662410 | 上传时间: 2019-12-21 20:49:51 | 文件大小: 6.97MB | 文件类型: zip
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查找该学生的信息,并同时获取其选课信息。 以上每种查询都使用嵌套查询和嵌套结果查询实现。

文件下载

资源详情

[{"title":"( 53 个子文件 6.97MB ) MyBatis的关联映射","children":[{"title":"mybatisrelation.sql <span style='color:#111;'> 4.46KB </span>","children":null,"spread":false},{"title":"数据库设计.docx <span style='color:#111;'> 220.93KB </span>","children":null,"spread":false},{"title":"fifth","children":[{"title":".project <span style='color:#111;'> 905B </span>","children":null,"spread":false},{"title":"WebContent","children":[{"title":"WEB-INF","children":[{"title":"lib","children":[{"title":"log4j-core-2.3.jar <span style='color:#111;'> 807.64KB </span>","children":null,"spread":false},{"title":"cglib-3.2.4.jar <span style='color:#111;'> 292.70KB </span>","children":null,"spread":false},{"title":"slf4j-log4j12-1.7.22.jar <span style='color:#111;'> 9.76KB </span>","children":null,"spread":false},{"title":"slf4j-api-1.7.22.jar <span style='color:#111;'> 40.11KB </span>","children":null,"spread":false},{"title":"ant-launcher-1.9.6.jar <span style='color:#111;'> 17.96KB </span>","children":null,"spread":false},{"title":"log4j-1.2.17.jar <span style='color:#111;'> 478.40KB </span>","children":null,"spread":false},{"title":"asm-5.1.jar <span style='color:#111;'> 52.21KB </span>","children":null,"spread":false},{"title":"javassist-3.21.0-GA.jar <span style='color:#111;'> 717.59KB </span>","children":null,"spread":false},{"title":"ant-1.9.6.jar <span style='color:#111;'> 1.94MB </span>","children":null,"spread":false},{"title":"mysql-connector-java-5.1.40-bin.jar <span style='color:#111;'> 967.70KB </span>","children":null,"spread":false},{"title":"commons-logging-1.2.jar <span style='color:#111;'> 60.38KB </span>","children":null,"spread":false},{"title":"log4j-api-2.3.jar <span style='color:#111;'> 132.72KB </span>","children":null,"spread":false},{"title":"mybatis-3.4.2.jar <span style='color:#111;'> 1.52MB </span>","children":null,"spread":false},{"title":"ognl-3.1.12.jar <span style='color:#111;'> 230.13KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 39B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"src","children":[{"title":"com","children":[{"title":"itheima","children":[{"title":"utils","children":[{"title":"MybatisUtils.java <span style='color:#111;'> 843B </span>","children":null,"spread":false}],"spread":true},{"title":"mapper","children":[{"title":"CourseMapper.xml <span style='color:#111;'> 1.63KB </span>","children":null,"spread":false},{"title":"StudentidcardMapper.xml <span style='color:#111;'> 406B </span>","children":null,"spread":false},{"title":"StudentMapper.xml <span style='color:#111;'> 1.66KB </span>","children":null,"spread":false},{"title":"ClassMapper.xml <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false}],"spread":true},{"title":"test","children":[{"title":"MybatisTest.java <span style='color:#111;'> 2.44KB </span>","children":null,"spread":false}],"spread":true},{"title":"po","children":[{"title":"Course.java <span style='color:#111;'> 490B </span>","children":null,"spread":false},{"title":"Class.java <span style='color:#111;'> 1.08KB </span>","children":null,"spread":false},{"title":"Studentidcard.java <span style='color:#111;'> 512B </span>","children":null,"spread":false},{"title":"Student.java <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"mybatis-config.xml <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false},{"title":"db.properties <span style='color:#111;'> 151B </span>","children":null,"spread":false},{"title":"log4j.properties <span style='color:#111;'> 334B </span>","children":null,"spread":false}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.wst.jsdt.ui.superType.container <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.project.facet.core.xml <span style='color:#111;'> 305B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 364B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.jsdt.ui.superType.name <span style='color:#111;'> 6B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.component <span style='color:#111;'> 467B </span>","children":null,"spread":false},{"title":".jsdtscope <span style='color:#111;'> 567B </span>","children":null,"spread":false}],"spread":true},{"title":"build","children":[{"title":"classes","children":[{"title":"com","children":[{"title":"itheima","children":[{"title":"utils","children":[{"title":"MybatisUtils.class <span style='color:#111;'> 1.09KB </span>","children":null,"spread":false}],"spread":true},{"title":"mapper","children":[{"title":"CourseMapper.xml <span style='color:#111;'> 1.63KB </span>","children":null,"spread":false},{"title":"StudentidcardMapper.xml <span style='color:#111;'> 406B </span>","children":null,"spread":false},{"title":"StudentMapper.xml <span style='color:#111;'> 1.66KB </span>","children":null,"spread":false},{"title":"ClassMapper.xml <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false}],"spread":true},{"title":"test","children":[{"title":"MybatisTest.class <span style='color:#111;'> 2.28KB </span>","children":null,"spread":false}],"spread":true},{"title":"po","children":[{"title":"Course.class <span style='color:#111;'> 1021B </span>","children":null,"spread":false},{"title":"Class.class <span style='color:#111;'> 1.97KB </span>","children":null,"spread":false},{"title":"Student.class <span style='color:#111;'> 2.68KB </span>","children":null,"spread":false},{"title":"Studentidcard.class <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"mybatis-config.xml <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false},{"title":"db.properties <span style='color:#111;'> 151B </span>","children":null,"spread":false},{"title":"log4j.properties <span style='color:#111;'> 334B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".classpath <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false}],"spread":true},{"title":"实验.docx <span style='color:#111;'> 16.83KB </span>","children":null,"spread":false},{"title":"运行结果图(参照).docx <span style='color:#111;'> 228.79KB </span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明