2010-11-29 74 views
2

可以将查询设置为以小写形式比较表中的所有记录吗?LiftPager Mapper中的LowerCase Like语句

例子: 我想建立查询:

SELECT * FROM items WHERE LOWER(item.title) LIKE (%abc%) 

但在映射对象一样,我不能说item.title必须是小写。

Like(Item.title, "%" + searchText.toLowerCase + "%") 

简单地说 - 用户在搜索字段中插入ABC,我想在结果项目aBc中查看他。

谢谢。

回答

3

我找到合适的解决方案:

完成我所有的发现 - 这里都是为了下一代正确的解决方案;)

Cmp(Item.title, OprEnum.Like, Full("%abc%"), None, Full("LOWER")) 

BySql[Item]("lower(title) LIKE ?", IHaveValidatedThisSQL("Kajo", "101129"), "%aBc%".toLowerCase)