查询结果中的major和major_name 为空
[Student [id=9, reg_no=20171201, name=梅长苏, sex=男, age=31, grade=2008, major=null, courses=[Course [id=1, courseid=c1011, major_name=null, courname=哲学概论, courteacher=黄裕生], Course [id=2, courseid=c1012, major_name=null, courname=科学技术哲学, courteacher=吴彤], Course [id=3, courseid=c1013, major_name=null, courname=伦理学, courteacher=万俊人], Course [id=4, courseid=c1014, major_name=null, courname=宗教学, courteacher=圣凯], Course [id=5, courseid=c1015, major_name=null, courname=美学, courteacher=肖鹰], Course [id=6, courseid=c1016, major_name=null, courname=心理学, courteacher=陈浩], Course [id=7, courseid=c1017, major_name=null, courname=逻辑学, courteacher=文明]]], Student [id=10, reg_no=20171202, name=萧景琰, sex=男, age=30, grade=2008, major=null, courses=[]], Student [id=11, reg_no=20171203, name=飞流, sex=男, age=18, grade=2016, major=null, courses=[]], Student [id=12, reg_no=20171204, name=萧景恒, sex=男, age=35, grade=2006, major=null, courses=[]], Student [id=13, reg_no=20171205, name=宫羽, sex=女, age=25, grade=2013, major=null, courses=[]], Student [id=14, reg_no=20171206, name=霓凰, sex=女, age=31, grade=2008, major=null, courses=[]], Student [id=15, reg_no=20171207, name=秦般弱, sex=女, age=30, grade=2009, major=null, courses=[]]]
正在回答 回答被采纳积分+1
你好,建议你检查一下测试类中的major参数是否为null,初步判断是程序在运行时,major参数没有传递过来,祝学习愉快~
- 参与学习 人
- 提交作业 277 份
- 解答问题 4297 个
Java数据库开发的必备技能,从流行的MySQL数据库开始,到Java原生的数据库管理接口JDBC的使用,再到常用的数据持久化框架MyBatis,让你向Java工程师的目标又迈进了一步!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星