Org.hibernate.propertyvalueexception:not-null property references a null or transient value:model.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.