-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to retrive count(*) using SQLQuery
PostPosted: Fri Mar 13, 2009 4:23 am 
Newbie

Joined: Fri Mar 13, 2009 4:08 am
Posts: 9
Hi,

I'm new to Hibernate. I developed a search functionality in JDBC. Now I need to convert it in hibernate. For this I'm using Hibernate SQLQuery because I need to join 3 tables.

But I'm facing a difficulty. I've a query like this :

select LOCATION, count(*) from Location_Table location left join st_sensor_table sensor on location.LOCATION = sensor.ST_SENSOR_ID where "+columnName+" like \"%"+ searchText + "%\" group by location.BM_BADGE_AT;

Now for every LOCATION I need count(*). I'm not getting the way out.
Please guide me how to do it.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 10:57 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Wrong forum. This forum is about Hibernate Search - the combination of Lucene and Hibernate to achieve fulltext search. It seems you are asking for plain SQL queries in Hibernate. That's a question for the Hibernate Users forum.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.