views:

25

answers:

1

My query in HQL is basically:

select functionA(a, :paramA), functionB(b, :paramB), functionC(c, :paramC), sum(d)
from tableA
groupby by functionA(a, :paramA), functionB(b, :paramB), functionC(c, :paramC)

However this gets turned into SQL of

select functionA(a, @param0), functionB(b, @param1), functionC(c, @param2), sum(d)
from tableA
groupby by functionA(a, @param3), functionB(b, @param4), functionC(c, @param5)

Now obviously this is going to throw a 'blah' is invalid in the select list because.... error as the group by clause doesn't match the select clause. I'm about to change this to a string format so I can get on with some productive work but if anyone has the answer as to why NHibernate will not reuse the same named query input the 2 times it is used that would be much appreciated.

A similar question seems to have been asked here with no real answer either.

+1  A: 

This has been solved in NHibernate 3.0.0.Alpha1. You can get it here

Diego Mijelshon
Thanks, I'll give it a go. It's lucky this is on a personal project where I'm happy to use alpha software, wouldn't get away with that on a client project.
toxaq
Don't let the name fool you - 3.0.0.Alpha1 is pretty stable, as it's based on the same codebase as 2.x and the project uses continuous integration.
Diego Mijelshon
Good to know, thanks again. Just trying it out now.
toxaq
Took a couple of gos to get all the right versions of DLLs but it is working perfectly. Cheers.
toxaq