Reputation: 13
I am using QueryOver
and islike
to get records from oracle db, but I want case insensitive
orgs = session.QueryOver<V_CM_ORG_GET>()
.SelectList(list => list
.SelectGroup(c => c.ORG_ID).WithAlias(()=>or.ORG_ID)
.SelectGroup(c => c.ORG_NAME).WithAlias(() => or.ORG_NAME)
.SelectGroup(c => c.PHONE).WithAlias(() => or.PHONE))
.Where(Restrictions.On<V_CM_ORG_GET>(y=>y.ORG_NAME)
.IsLike(query,MatchMode.Anywhere))
.TransformUsing(Transformers.AliasToBean<OrgsObj>())
.List<OrgsObj>();
Upvotes: 1
Views: 2082
Reputation: 123861
Not fully sure if you really tried to search:
As stated there, solution would be like this:
// instead of this
.Where(Restrictions.On<V_CM_ORG_GET>(y=>y.ORG_NAME)
.IsLike(query,MatchMode.Anywhere))
// use this
.WhereRestrictionOn(y => y.ORG_NAME)
.IsInsensitiveLike(query, MatchMode.Anywhere)
Upvotes: 9