Do not copy&paste the query from dao.getConcepts... Extract the query creation to a new method and use it in getConcepts and getCountOfConcepts