[NH] Ability to use Aggregate Projections on Projections [NH-1393]
"Tuna Toksöz" <[email protected]> Tue, 22 Jul 2008 14:58:00 +0300
| Newsgroups | gmane.comp.windows.dotnet.nhibernate.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello everybody,
The issue is here
http://jira.nhibernate.org/browse/NH-1393
Basically, the problem is we cannot do following
[Test]
public void CanAvgProjectionOnSqlFunction()
{
using (ISession s = OpenSession())
{
ISQLFunction arithmaticAddition = new
VarArgsSQLFunction("(", "+", ")");
ICriteria c = s.CreateCriteria(typeof(Person))
.SetProjection(
Projections.Avg(Projections.SqlFunction(arithmaticAddition,
NHibernateUtil.GuessType(typeof(double)),
Projections.Property("IQ"),
Projections.Property("ShoeSize"))));
IList list = c.List();
Assert.AreEqual( 334/5,list[0]);
}
}
What I want to ask is, should I go for SqlFunction projections, or any
projection. Projection is not error-safe, I mean user may try to aggregate
on Subquery projection, which is illegal in MSSQL(and probably the others.
So my question is, Should I go for Projection or restrict it to
SqlFunctionProjection.
--
Tuna Toksöz
Typos included to enhance the reader's attention ...
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development