Re: Question regarding Hibernate ORDER BY issue

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Question regarding Hibernate ORDER BY issue
Дата
Msg-id 20071020005911.GB24660@alvh.no-ip.org
обсуждение исходный текст
Ответ на Question regarding Hibernate ORDER BY issue  ("Valerie Cole" <valerie.cole@wirestone.com>)
Список pgsql-general
Valerie Cole wrote:

> I have a problem and am pretty sure Hibernate is the culprit but was
> wondering if anybody knew of a fix.  We are working on legacy code and
> converted a class from Hibernate 2 xml mappings to Hibernate 3 with
> annotations.  On one of the One To Many attributes we have used the
> @OrderBy("displayPosition").  The SQL generated by Hibernate outputs the
> column name as DisplayPosition with no quoting, and Postgres kicks back
> an error saying the column does not exist.

Did you try adding extra double quotes?  Something like
@OrderBy("\"displayPosition\"").

> Our tables/columns have all been created with quotes and must be
> accessed with quotes (I don't know if that is the norm, I am somewhat
> of a Postgres newb).

This is correct, unless your table/column names (a.k.a. "identifiers")
are lowercase in which case you can leave the quotes out.

--
Alvaro Herrera                         http://www.flickr.com/photos/alvherre/
A male gynecologist is like an auto mechanic who never owned a car.
(Carrie Snow)

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

Предыдущее
От: Josh Trutwin
Дата:
Сообщение: Re: Questions about LIMIT/OFFSET
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: ERROR: Could not access status of transaction ####