• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rows count in hql

 
meghana maganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to retrieve the number of rows returned with out retrieving the data, can anyone help me how to do this.

I tried some thing like this
select count(*) from table11 join.. where ....

Usually select .. from ... returns a list but I need the result into an int variable which gives me the number of rows with out bringing in the rows.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually select .. from ... returns a list

list.size()?
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the Hibernate Documentation section 15.14.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!