Hibernate 一个小疑点,POJO是否一定要空的构造方法
Hibernate 一个小问题,POJO是否一定要空的构造方法使用Hibernate POJO我一般都是空的构造再加上有参构造,
Hibernate 一个小问题,POJO是否一定要空的构造方法
使用Hibernate POJO我一般都是空的构造再加上有参构造,以前看到很多人都说hibernate是通过反射来实现的,所以必须有空构造,今天我把空的构造去掉了,只有一个有参构造,结果还是通过,不是说必须有无参吗?
谁能解答下
?
1 楼 caihuashan 2010-08-12 Sorry,Everyone!
I am a new guy,so I have make a big mistake,I just test saveMethod ,and when I test findMethod,there are some Exceptions,and one of them is need a default constructor for entity.
Next time I will be more careful!! 2 楼 lg_asus 2011-07-27 good,I was also confused with this. thanks for sharing .