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.
Joined: Dec 11, 2006
Have you tried making that HQL count a named query and accessing it with that long-named method?
Joined: Jul 10, 2007
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.