Originally posted by Edvins Reisons: See the aggregate functions in the Hibernate Reference.
That was allready clear. But, I had to create a query in the mapping file and access it through findByNamedQueryAndNamedParam. Is the no better way to get a count? If not I could just use JDBC to get the count in stead of going through Hibernate.
Edvins Reisons
Ranch Hand
Joined: Dec 11, 2006
Posts: 364
posted
0
Have you tried making that HQL count a named query and accessing it with that long-named method?
Sverre Moe
Ranch Hand
Joined: Jul 10, 2007
Posts: 109
posted
0
Originally posted by Edvins Reisons: Have you tried making that HQL count a named query and accessing it with that long-named method?
Yes, and it worked. I was just hoping I could use the mapped object in some way instead of creating a named query. Or perhaps Hibernate is not meant to be that way. That all other than getting a complete object (one row) of data or a list of them should be accessed through named queries. Such as queries with mathematical operations.