hibernate添加数据时Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: com.javakc.hibernate.test.entity.TestEntity.testName2021-07-12 05:00:46 意思是,一个非null属性引用了一个null或瞬态值。就是在对应实体类配置文件hbm.xml中该属性配置了not-null="true",将其去掉即可。上一篇:Hibernate错误:Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update下一篇:Exception in thread "main" org.hibernate.HibernateException: save is not valid without active transaction