IProjection postCodeSubstring = Projections.SqlFunction
("substring", NHibernateUtil.String, Projections.Property
("FirstName"),
Projections.Constant(1), Projections.Constant(2));
List<string> deptsIds = new List<string> {"one", "two", "three",
"four", "five"};
criteria.Add(Restrictions.In(postCodeSubstring, deptsIds));
Provides this SQL:
SELECT this_.Id as Id0_0_, this_.FirstName as FirstName0_0_,
this_.LastName as LastName0_0_, this_.Context as Context0_0_,
this_.Store_id as Store5_0_0_ FROM [Employee] this_ WHERE substring
(this_.FirstName, @p0, @p1) in (@p2, @p3, @p4, @p5, @p6);@p0 = 1, @p1
= 2, @p2 = 1, @p3 = 2, @p4 = 'one', @p5 = 'two', @p6 = 'three', @p7 =
'four', @p8 = 'five'
What am I doing wrong here?
Any ideas would be highly appreciated :)
On Nov 14 2009, 2:20 pm, Dinesh <dinesh...@gmail.com> wrote:
> I had a scenario in Oracle where i neeed to match asubstringpart of
> column with a list of values. i was using sqlfunction projection for
> applying thesubstringon the required column , and included that
> Any suggestions on whetherprojectionswork fine when used with the