liyifeng1994 / ssm

手把手教你整合最优雅SSM框架:SpringMVC + Spring + MyBatis

Home Page:http://blog.csdn.net/qq598535550/article/details/51703190

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么我在测试AppointmentDao的时候,返回book的时候,bookId是1000,但是name和number是null?

nicenice0316 opened this issue · comments

但是我手动将xml里面的sql去查询的时候,是有返回值的

resultType 检查没有

和这个例子一模一样,除了把book表里面的name和number换成b_name,b_number
@Draymonder

实体类属性和表字段要一致才行,如果不一致需要配置resultMap.类似: