Could not find a getter for salesName in class
2012-10-25 12:14
447 查看
其他的解释不说,说一个网上没有的。
当数据库定义了一个属性(列),它的名称是含有大写字母的,如salesName,那么就要在**.hbm.xml文件的property的name属性为小写。
如果是这样:<property name="salesName" column="salesName" type="string">
将出现错误:Could not find a getter for salesName in class **
解决办法:把property 的name属性改成小写,不管POJO文件是把该属性(字段)定义为salesName还是salesname都可以改。
也就是:<property name="salesname" column="salesName" type="string">
这样就可以解决bug啦。
当数据库定义了一个属性(列),它的名称是含有大写字母的,如salesName,那么就要在**.hbm.xml文件的property的name属性为小写。
如果是这样:<property name="salesName" column="salesName" type="string">
将出现错误:Could not find a getter for salesName in class **
解决办法:把property 的name属性改成小写,不管POJO文件是把该属性(字段)定义为salesName还是salesname都可以改。
也就是:<property name="salesname" column="salesName" type="string">
这样就可以解决bug啦。
相关文章推荐
- org.hibernate.PropertyNotFoundException:could not find a getter for name in class ....
- could not find a getter for ... in class ... 异常的解决
- could not find a getter for in class方法解决
- org.hibernate.PropertyNotFoundException: Could not find a getter for employee in class com.itcast.f_hbm_oneToMany.Department
- org.hibernate.PropertyNotFoundException: Could not find a getter for id in class com.pb.dao.UserDao
- could not find a getter for ... in class ... 异常的解决
- hibernate出现:org.hibernate.PropertyNotFoundException: Could not find a getter for id in class
- org.hibernate.PropertyNotFoundException Could not find a getter for id in class
- could not find a getter for ... in class ... 异常的原因解析
- could not find a getter for ... in class ...
- nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for eNum in class
- Debug:SSH继承时 could not find a getter for ... in class ... 异常的解决
- could not find a getter for ... in class ... 异常的原因解析
- Unable to instantiate default tuplizer/Could not find a getter for orders in class
- org.hibernate.PropertyNotFoundException: Could not find a getter for titlse in class com.po.Intro异常
- could not find a getter for ... in class ... 异常的解决
- could not find a getter for ... in class ... 异常的解决
- could not find a getter for ... in class ...
- could not find a getter for ... in class ... 异常的解决
- org.hibernate.PropertyNotFoundException: Could not find a getter for empDeptId in class