When you map an entity through hibernate, the corresponding primary key type in the corresponding Pojo class is generated based on the precision of the number type in the database. Following the results of the pro-test:
Number ( 1 )
A Boolean is generated in the Pojo class
Public class Test implements java.io.Serializable { Fields Private Boolean ID; } |
Number ( 2 )
A byte is generated in the Pojo class
Public class Test implements java.io.Serializable { Private Byte ID; } |
Number ( 3 ) Number ( 4 )
Number ( 5 ) Number ( 6 ) Number ( 7 ) Number ( 8 )
Number ( 9 )
Number ( Ten ) Number ( One ) Number ( A ) Number ( - )
Number ( - ) Number ( the ) Number ( - ) Number ( - )
Number ( - )
Number ( + ) ----- Number ( - )
When number has no precision, the default 38-bit
Transferred from: http://sunwws.iteye.com/blog/2044140
Hibernate number Precision