hibernate nativequery and uuid
От | Andrew |
---|---|
Тема | hibernate nativequery and uuid |
Дата | |
Msg-id | 4892355E.9030903@pacific.net.au обсуждение исходный текст |
Ответы |
Re: hibernate nativequery and uuid
|
Список | pgsql-general |
I'm currently using JPA with Hibernate as my ORM and have been able to convince hibernate to play nicely with the Postgresql UUID. Most of my queries have been in EJBQL using the JPA entity manager's createQuery. However when I try to do a UNION, JPA only returned the results of the first query, and ignored the other UNION queries, which is in line with what I have read online, in that JPA does not support UNIONS. So I'm currently attempting to go via a createNativeQuery call. The keys on the target tables are PostgreSQL UUID data types. When doing so I get the following error: org.postgresql.util.PSQLException: ERROR: operator does not exist: uuid = character varying The only relevant thing I have been able to find relating to it is http://archives.postgresql.org/pgsql-bugs/2007-12/msg00061.php which suggests adding a ::uuid cast to the parameter. However, when doing that, hibernate thinks that it is a named parameter and complains. org.hibernate.QueryException: Not all named parameters have been set Hibernate's functionality to declare an escape character for a LIKE clause does not apply to this. But in attempting to escape the colons, getting various other hibernate parsing errors, so my attempts down this path has not been of help. Has anyone else run into this issue and been able to resolve it? I'm using Postgresql 8.3.3 on Windows XP, Hibernate 3.2.6.GA and the Postgresql 8.3-603 JDBC4 driver. Thanks, Andy
В списке pgsql-general по дате отправления: