How to implement a SQL like 'LIKE' operator in java?

后端 未结 15 1448
你的背包
你的背包 2020-11-29 03:12

I need a comparator in java which has the same semantics as the sql \'like\' operator. For example:

myComparator.like(\"digital\",\"%ital%\");
myComparator.l         


        
15条回答
  •  旧巷少年郎
    2020-11-29 04:03

    Apache Cayanne ORM has an "In memory evaluation"

    It may not work for unmapped object, but looks promising:

    Expression exp = ExpressionFactory.likeExp("artistName", "A%");   
    List startWithA = exp.filterObjects(artists); 
    

提交回复
热议问题