Say I have the following native SQL:
SELECT a, b, c + d AS cd
FROM stuff
I know it’s easy to just sort it using order by.
I was just wondering if JPA/Hibernate has a way to specify ordering AFTER the query executes and the results have returned, e.g. for sorting by the cd column. Basically something like a Comparator (except it’s built into the ORM).
not that i know of. but i would say that your db is usually much more efficient at sorting the data than any code you would write. i would stuck with letting the db do i.