How to use regular expressions with Hibernate/Oracle

前端 未结 2 1546
春和景丽
春和景丽 2020-12-18 09:35

I\'m trying to implement a web service which accepts a list of strings, each of which is a regular expression. These need to be compared against six columns of a database,

2条回答
  •  春和景丽
    2020-12-18 10:14

    Similar working example

     Criterion criterion = Restrictions.sqlRestriction("regexp_like (column_name, ?, 'i')", "(^|\\s)"+searchValue+"($|\\s|.$)", StringType.INSTANCE);
    

提交回复
热议问题