Hibernate and Postgres – a custom UserType to handle arrays

October 27, 2011

0

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 […]

Posted in: Geek, Hibernate, Java, Postgres

How to map smallint type in Hibernate to Postgres

October 19, 2011

0

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:

Posted in: Geek, Hibernate, Java, Postgres
Follow

Get every new post delivered to your Inbox.