I struggled for quite some time and there was not much documentation
@OleksiiSkachkov You should be careful with LOWER() I cannot exactly remember which database engine had problems with that but I test my app against MySQL, PostgreSQL, Oracle and MSSQL and one of them had problems with LOWER(). That is why I created these lowercase shadow columns as a workaround. But maybe active objects can now handle it
And also be careful. AND is stronger than OR. So you really need some extra brackets. ( some LIKE ? OR other LIKE ? ) AND foo = ?