Unsigned Int in JPA and Hibernate

What can I do? Does JPA (I use Hibernate) create columns with Unsigned types? All of my identity columns are currently signed.

+7
source share
1 answer

Using the columnDefinition property in the columnDefinition annotation should be done. Accepting the general assumption about the type of SQL you are going for:

 private long foo; @Column(columnDefinition = "UNSIGNED INT(11)") public long getFoo() { return foo; } 

NB Not all databases (e.g. SQL Server, I think) support unsigned int types.

+13
source

All Articles