LPS–43952 Sorting and filtering of web content does not work with oracle db

First commit (f13e9f2) fixed the bug quick&dirty.
Next ones refactor all the comparators in order to remove duplicated code.
Tests also included (cc @mdelapenya)