int is one of the 8 raw data types provided by Java.
Java provides encapsulation classes for each primitive type, and integer is the wrapper class provided by Java for Int.
The default value for int is 0, and the default value for integer is null, that is, the difference between an unassigned and a value of 0 can be distinguished by an int, which cannot express an unassigned condition.
In JSP development, the default for integer is null, so when displayed in a text box with an El expression, the value is a blank string, and the default value of int is 0, so the result is 0 when displayed in a text box with an El expression, so int does not work together as a type of form data for the Web tier.
In Hibernate, if an OID is defined as an integer type, hibernate can determine whether an object is temporary based on whether its value is null or not, and if the OID is defined in the case of an int type, it needs to be set in the HBM mapping file The Unsaved-value property is 0.
The difference between an Integer and an int