michael wrote:
Doesn't adding "order by index(p)" to the hql solve that?
Well in SQL it is translated as "
order by index(publicat2_.id)"
and postgreSql returns an error (the function index(bigint) is unknown)
So index() does not seems to be an HQL keyword.
But really I was thinking about something like that, maybe rather index(s.publications) (considering that in the Hibernate Mapping the index is declared with the list).
Didn't saw anything like that in the documentation, though.
:(
logs:
Hibernate: select publicat2_.id as id, publicat2_.name as name,
publicat2_.workflow_type as workflow3_, publicat2_.datepubli as datepubli,
publicat2_.datedebvalid as datedebv5_, publicat2_.datefinvalid as
datefinv6_, publicat2_.metadata as metadata, publicat2_.type_id as type_id,
publicat2_.version_online_id as version_9_, publicat2_.last_version_id as
last_ve10_
from sections sectioni0_ inner join sections_publications publicat1_ on
sectioni0_.id=publicat1_.section_id inner
join publications publicat2_ on publicat1_.publication_id=publicat2_.id
inner join publication_profil profils3_ on
publicat2_.id=profils3_.publication_id
innerjoin profil profilim4_ on profils3_.profil_id=profilim4_.id
where (sectioni0_.id=70352897 )and(profilim4_.id in(69304321))
and((publicat2_.datedebvalid<=current_date )or(publicat2_.datedebvalid is
null ))
and((publicat2_.datefinvalid>=current_date )or(publicat2_.datefinvalid is
null )) order by index(publicat2_.id)
org.nextime.ion.framework.exception.DataBaseException:
net.sf.hibernate.JDBCExce
ption: Could not execute query: ERROR: Function index(bigint) does not
exist
Unable to identify a function that satisfies the given argument
types
You may need to add explicit typecasts
at
org.nextime.ion.framework.persistentServices.DBService.getObjects(DBS
ervice.java:145)