[misc] Refactoring for better variable names, better performance
(cherry picked from commit 40a78144c22b11172be07d0ee05c6defebdb0ac6)
XWIKI-9057: Can't select "doc.fullName" as a column in the query for a DBList property
Fixed.
(cherry picked from commit 632df195233ea8e3f9a0d2a6c89b0e66e8027e57)