SORM Framework: whereContains

113 Views Asked by At

Is it possible to filter the rows which string-columns contains special substring? Expressions like .whereContains("name", "Pavel") throws exception: Exception: Filter "Contains" is not supported for mapping "String". Of course, I can easily use scala filter but DB should do it better, isn't it?

1

There are 1 best solutions below

2
On BEST ANSWER

It seems like in whereContains the path should refer to some collection, for example if you were searching for a name within a set of nested names of some entity.

What you want is to use whereLike("name", "Pavel"), which uses an SQL LIKE clause used for substring matching.