hql get objects where objects' property is "substring" of input value
I am running into similar situation as this post. My pseudo code is
string hql = "select ai from AreaInfo as ai where ai.PhoneSegment is substring of :InputPhoneNumber";
Using like wouldn't do the trick because what Like is doing is
string hql = "select ai from AreaInfo as ai where :InputPhoneNumber is substr开发者_StackOverflowing of ai.PhoneSegment";
So, what is the correct syntax to perform this task? My environment is Castle ActiveRecord on top of NHibernate. Thanks in advance.
I believe you're trying to do something like this:
select ai from AreaInfo ai where :InputPhoneNumber like concat('%', ai.PhoneSegment)
Is that it?
精彩评论