hibernate matchmode
- 作者: ----------________
- 来源: 51数据库
- 2021-01-18
这段qbc查询的代码翻译成sql大概是:
select * from Film
where description like '%key%'
or name like '%key%'
or direct like '%key%'
or mainplay like '%key%'
or filearea like '%key%'
start end anywhere exact是like的匹配方式
MatchMode.START:字符串在最前面的位置.相当于"like 'key%'"
MatchMode.END:字符串在最后面的位置.相当于"like '%key'"
MatchMode.ANYWHERE:字符串在中间匹配.相当于"like '%key%'"
MatchMode.EXACT:字符串精确匹配.相当于"like 'key'"
select * from Film
where description like '%key%'
or name like '%key%'
or direct like '%key%'
or mainplay like '%key%'
or filearea like '%key%'
start end anywhere exact是like的匹配方式
MatchMode.START:字符串在最前面的位置.相当于"like 'key%'"
MatchMode.END:字符串在最后面的位置.相当于"like '%key'"
MatchMode.ANYWHERE:字符串在中间匹配.相当于"like '%key%'"
MatchMode.EXACT:字符串精确匹配.相当于"like 'key'"
推荐阅读
