java - Postgresql 'select distinct on' in hibernate -


does hibernate has support on select distinct on queries?

select distinct on (location) location, time, report weather_reports order location, time desc; 

is there way create hibernate criterias query?

since there "suspecting" , "guessing" here, when stumbled across question, i'll answer definitely:

no, hibernate not support distinct on query.

org.hibernate.hql.internal.ast.querysyntaxexception:  unexpected token: on near line 1, column 17 [select distinct on (location) location, time, report weather_reports order location, time desc] 

tested under hibernate 4.3.9-final

please note doesn't apply normal distinct queries. see https://stackoverflow.com/questions/263850...


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -