开发者

Problem in HQL query

开发者 https://www.devze.com 2022-12-26 05:47 出处:网络
I written a query in my sql like this: \"select * from table_name order by col_name = 101 desc \" Which is working perfectly fine in mysql but when I tried to convert this query into HQl query then

I written a query in my sql like this:

"select * from table_name order by col_name = 101 desc "

Which is working perfectly fine in mysql but when I tried to convert this query into HQl query then it is throwing an excepti开发者_StackOverflowon.So can anyone suggest me that how to write HQL query for the above SQL query.


i doubt that's working fine in mysql... did you mean something like

select * from table_name where col2_name = 101 order by col1_name desc

in hibernate you pretty much just need to replace table_name and col_name with the actual class and property names, eg (you can leave off the select if you're just querying a whole entity)

FROM EntityName where property1Name = 101 order by property2Name desc

0

精彩评论

暂无评论...
验证码 换一张
取 消