The model you're using is called adjacency list and it requires a recursive query to deal with.
In SQL Server
and several other engines this can be achieved through use of so called recursive CTE (common table expressions):
WITH q AS
(
SELECT *
FROM entries
WHERE entryId = @leafEntryId
UNION ALL
SELECT e.*
FROM q
JOIN entries e
ON e.entryId = q.parentEntryId
)
SELECT *
FROM q