Re: [HACKERS] JPA + enum == Exception

Поиск
Список
Период
Сортировка
От Tom Dunstan
Тема Re: [HACKERS] JPA + enum == Exception
Дата
Msg-id CAPPfruw2cBztp+k6NTFVGHQL2JweoVYY8JTBoXHEVFMsQKT_Lg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] JPA + enum == Exception  (Kris Jurka <books@ejurka.com>)
Ответы Re: [HACKERS] JPA + enum == Exception  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-jdbc
On 9 February 2013 02:56, Kris Jurka <books@ejurka.com> wrote:
The other workaround is to use the url parameter stringtype=unspecified to
have setString always bind to unknown instead of varchar, which then
shouldn't require any code changes.

I just tried this with a new project using hibernate and postgres with an enum type . Unfortunately, the hibernate (3.6) enum type calls setObject(pos, value, Types.VARCHAR) rather than calling setString(pos, value), and that doesn't respect the stringtype property.

What's the feeling here - should setObject(Types.VARCHAR) respect stringtype=unspecified? I don't know whether there are semantic differences between setString() and setObject(Types.VARCHAR) to know if that's naughty or not. It seems like the only way for me to use this version of hibernate with pgsql enums is to either change the driver or implement a custom user type and configure it everywhere. :(

Happy to whip up a patch if there's consensus to change the driver.

Cheers

Tom

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: dmp
Дата:
Сообщение: Re: Project plans
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: [HACKERS] JPA + enum == Exception