解决 Null value was assigned to a property
晚上开始写贴吧分类,把class改成category,规避了关键字class,也显得更合理,百度的分类就是ct 然后在分类上遇到一个小问题,category_father在数据库是integer类型,可以为null,因为存在根分类,在这种情况下用Hibernate读取 Category时会产生错误 在jUnit单元测试中就通不过,错误为 org.hibernate.PropertyAccessException: Null value was assigned to a property Google后,发现Category中定义categoryFather为int类型,是不支持null的,需要改为Wrapper类Interger ...
