[11-07 10:55:28] [http-bio-8080-exec-2] [ERROR] [com. shinowit. dao. baseDAO-179]-Null value was assigned to a property of primitive type setter of com. shinowit. entity. TAuOperInfo. id
Org. hibernate. PropertyAccessException: Null value was assigned to a property of primitive type setter of com. shinowit. entity. TAuOperInfo. id
When a field value in the database is NULL and objects are persistently associated, an error occurs because this attribute of the object cannot be NULL. [Int type, cannot be blank]
As mentioned before, int type items cannot be empty.
Solution: define the type of the field in the class as Integer.
Difference between Integer code and int code:
Integer is the object code = null; the object can be null.
Int is a common type and cannot be null.
The code in the database can be empty, so it should be mapped to the Integer type. In addition, the java. long. Integer packaging class should be used in hibernate, and the basic type Integer should not be used.
Error! Error! Error!