HHH-8281 Fixes non-deterministic result set ordering on paginated query