hibernate添加数据时Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: com.javakc.hibernate.test.entity.TestEntity.testName

  

     意思是,一个非null属性引用了一个null或瞬态值。就是在对应实体类配置文件hbm.xml中该属性配置了not-null="true",将其去掉即可。

原文地址:https://www.cnblogs.com/wisir/p/8836806.html