resultMap使用不当导致出现There is no WRITEABLE property named 'student_id' in class 'com

来源:互联网 发布:java设计模式使用场景 编辑:程序博客网 时间:2024/06/05 14:38

resultMap使用不当导致出现There is no WRITEABLE property named 'student_id' in class 'com

by admin on 2014-04-25 14:34:37 in , 2650次




BUG的原因:
1. resultMap是结果集的关系映射,property是实体属性(也就是Student.java里面指定的成员变量),column是数据表中与之对应的属性
2. 当指定了resultMap后,必须保证property在class中能找到,并且名字一致,并且有对应的get(property名)、set(propety名)方法,因为映射的时候是用property名字在class中找到get、set方法的

0 0
原创粉丝点击