Today in the writing of an SSH integration project, the database operation part of the first separate out, after writing to use JUnit to test, after testing, found that there is no problem, the content of the database to be modified to check no problem, but the integration of him into the project in SSH, reported such a mistake Org.hibernate.propertyvalueexception:not-null property references a null or transient value:model. Transactionrecord.remark. It was very confusing at the time because there was no problem when testing in JUnit, but copying the code into the project would be an error. At that time did not carefully look at the error stack information, see a NOT NULL to think it might be the parameter passed the wrong time, and then call the method when the parameters are all printed output again, but the magic is that the parameters are not any problem, then the problem, the parameters and methods are no problem in the end what is wrong? Calm down. Error message re-read the following, the error means that the remark property of this class is empty, throws the exception, and then transactionrecord the mapping file, Found in the mapping file for remark This property set a Not-null property to True, and then use Transactionrecord without assigning a value to remark. This error disappears when the Not-null attribute of the remark is removed or assigned to the remark after it is run.
Org.hibernate.propertyvalueexception:not-null property references a null or transient value:model.