I think the best way to select latest row it using index descening
set username, updated
columns as descening index
if you dont have index on those columnes, for more information how to set it you can look link bellow
https://www.postgresql.org/docs/9.5/static/sql-createindex.html
then your select will be like this
SELECT * FROM Post p where p.user.username = :username LIMIT 1
your reading data will be already descening sortet after select, an then you can select 1 row and it will be latest row, data was decening sorted by username
(and it is in where clause) and updated
column
and about limit in HQL, you can solve this problem by other way
please look links bellow
https://groups.google.com/forum/#!topic/nhibernate-development/JYE3NDcTUEA
How do you do a limit query in HQL?
LIMIT in Postgres not supported in HQL?