Here is a custom Hibernate UserType that will work to persist Java array types (string[], int[], boolean[], etc..) in a single column. I have seen Oracle implementations, but here is one that uses Java.sql.array and works for Postgres. If you’d like to know more about how this works, Andrew Phillips has written a great explanation […]

Hibernate does define a “smallint” type. If you try to set the Type to smallint, you’ll get an error stating “Could not determine type for: smallint”. So what type should be used when mapping to a smallint field? The answer is to use “short: