Record collections can be sorted efficiently at the database level using the ORDER BY clause. Syntax:
[ORDER BY {ComponentAlias.columnName} [ASC | DESC], ...]
FROM User.Phonenumber ORDER BY User.name, Phonenumber.phonenumber FROM User u, u.Email e ORDER BY e.address, u.id
FROM User u, u.Email e ORDER BY e.address DESC, u.id ASC;