Hibernate version: 2.1
Name and version of the database you are using: MySQL 4.0.12
I'm trying to write the following sql in hibernate:
Code:
select count(*) as total , category from tbl_search_tracking group by category order by total
I tried the following:
Code:
select count(*) as total, st.category from SearchTrack st where [condition]
group by st.category order by total
and it generated the following error:
Code:
com.emirca.touch.module.business.model.BusinessManager runPopularSearchReportWARNING: Error running 'search number per portal' , expected in SELECT [select new com.emirca.touch.module.business.model.SearchTrack(count(*) alias tot, st.category) from com.emirca.touch.module.business.model.SearchTrack st where st.searchDate >= :fromDate and st.searchDate <= :toDate and st.portalName = :portal group by st.category ]
Is setting column aliases not possible in Hibernate?
Thanks,
Cagan