Fixed
Details
Details
Assignee
Richard Brown
Richard BrownReporter
Richard Brown
Richard BrownComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created May 1, 2011 at 3:42 AM
Updated July 30, 2011 at 2:11 PM
Resolved June 4, 2011 at 12:20 PM
Some of the common functions (that are registered in most, if not all Dialects) can be used in ICriteria using SQL-projections.
Extensions methods can be added for these to allow queries along the lines of:
s.QueryOver<Person>()
.Where(p => p.BirthDate.Year() == 1970)
.List()
... which can be translated to:
.Where(Restrictions.Eq(Projections.SqlFunction("year", NHibernateUtil.DateTime, Projections.Property<Person>(p => p.BirthDate)), 1970))
... and in turn to:
datepart(year, this_.BirthDate) = @p0;