Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Дата
Msg-id AANLkTik_5mWeWs7RyVwa7-3BgDdgH1QR3XSYQntY9-7e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4  (sdavidr <david.ricoma@gmail.com>)
Ответы Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4  (Samuel Gendler <sgendler@ideasculptor.com>)
Список pgsql-jdbc
On 29 March 2011 02:05, sdavidr <david.ricoma@gmail.com> wrote:

> Hibernate could receive a lot of numbers from a "returning *" but doesn't
> know what is the correct value. It expects to be the first element, but if
> is not, it fails.

Ok, so this is really a Hibernate bug. Hibernate needs to be fixed to
either request the correct generated column, or to choose the correct
column from the resultset. Of course, working out what the "correct
column" is could be tricky, but at least Hibernate has access to the
application's description of its data model so it's in a much better
position than the driver to do this.

> In another way, method from postgres driver getGeneratedKeys cannot return
> the full table, isn't it?

As Dave said, unless you explicitly ask for certain columns, it gives
you the entire inserted row because trying to determine a smaller set
of "generated" columns requires information that the driver doesn't
have. It's fine from a spec point of view to do this. Also, even if we
could find a smaller set of columns to return, there still might be
more than one and Hibernate would still fail ..

Oliver

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: idea to have driver return immediately after a query
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: JDBC gripe list