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
精彩评论