Refactoring, adding distinct select in getAllEntityNamesServlet