Commit 945390cf by Rubén Ramírez

feat: [RepositorioRecurso]: Añadida una función en el repositorio para obtener el ranking

parent 1166bb2f
...@@ -97,4 +97,14 @@ public class RepositorioRecurso { ...@@ -97,4 +97,14 @@ public class RepositorioRecurso {
.getSingleResult(); .getSingleResult();
return count > 0; return count > 0;
} }
@Transactional(readOnly = true)
public List<Recurso> obtenerTopRecursosUltimaSemana() {
return em.createQuery(
"SELECT r FROM Recurso r ORDER BY r.contadorAccesosSemanal DESC",
Recurso.class)
.setMaxResults(5)
.getResultList();
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment