开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜