3
は、私は私の方言サブクラスでSQL関数を登録しているので、NHibernateのQueryOver構文でSqlFunctionのMAX()を選択できますか?
var q = _session.QueryOver<Event>()
.Select(
Projections.SqlFunction(
"addseconds",
NHibernateUtil.Date,
Projections.Property<Event>(x => x.DurationInSeconds),
Projections.Property<Event>(x => x.StartTime)));
SQLを生成するようにクエリで使用することができます
RegisterFunction("addseconds", new SQLFunctionTemplate(NHibernateUtil.Date, "dateadd(second, ?1, ?2)"));
SELECT dateadd(second,
this_.DurationInSeconds,
this_.StartTime) as y0_
FROM [Event] this_
が、私は本当によ何後は
SELECT MAX(dateadd(second,
this_.DurationInSeconds,
this_.StartTime)) as y0_
FROM [Event] this_
残念ながら、私はProjections.SqlFunctionを取るためにSelectMaxを得ることができません。それはできますか?