hibernate实体类报错:Could not find a setter for property * in class * 解决方法
2017-06-26 18:51
441 查看
一、说明
这是由于hibernate @Entity @Table 实体类中不可以随便添加与表字段不对应的get方法,如增加请加注解 @Transient
注意:这种方法包括isXXX方法(比如下面例子的isEmpty方法)
二、例子
这是由于hibernate @Entity @Table 实体类中不可以随便添加与表字段不对应的get方法,如增加请加注解 @Transient
注意:这种方法包括isXXX方法(比如下面例子的isEmpty方法)
二、例子
@Transient public int getTotalEnrollment() { return enrolledStudents.size(); } @Transient public boolean isEmpty() { if (sectionsOffered.size() == 0) return true; else return false; }
相关文章推荐
- 解决:ould not find a getter for porDate in class com.bc.bean.PortalSheet Caused by: org.hibernate.PropertyNotFoundException: Could
- could not find a getter for in class方法解决
- ”Could not find tag for codec none in stream #0, codec not currently supported in container”的解决方法
- nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for eNum in class
- could not find a getter for ... 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 ... 异常的解决
- Debug:SSH继承时 could not find a getter for ... in class ... 异常的解决
- org.hibernate.PropertyNotFoundException Could not find a getter for id in class
- org.hibernate.PropertyNotFoundException: Could not find a getter for id in class com.pb.dao.UserDao
- could not find a getter for ... in class ... 异常的解决
- org.hibernate.PropertyNotFoundException: Could not find a getter for empDeptId in class
- org.hibernate.PropertyNotFoundException: Could not find a getter for employee in class com.itcast.f_hbm_oneToMany.Department
- 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 name in class ....
- could not find a getter for ... in class ... 异常的解决
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- PropertyNotFoundException:could not find a setter forXXX
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法