views:

81

answers:

1

Recently CF9 released Hibernate Support. One thing that I cant grasp is the diiferences between Hibernate and CFquery. While i see that Hibernate is good for mapping out your tables to objects and then calling those objects like getTableName() etc. But say if i want to replicate this query

SELECT SUM(tableVal) FROM mytable

Dont i still have to use HQL and call the query. If I do then whats the use of hibernate. it just seems like another route to essentially get the same data.

I'm 100000% sure im missing a BIG concept here. If anyone can clairfy the differences and point me at some resources it would be amazing.

Thanks, Faisal Abid

+3  A: 

HQL would work, basic SQL in cfquery would still work as well.

The strength of Hibernate is not doing aggregated functions like SUM() or AVG(), but the Mapping of Object Relations (ORM).

Henry
If you want SUM() AVG() or any sort of aggregate functions in nHibernate I find it's easiest just to create a view with the query you want.
Spencer Ruport