Commit 6ba087e1 by Rubén Ramírez

feat: [RepositorioUsuario]: Creaa una función para obtener un listado de usuarios

parent cfb55e05
...@@ -77,4 +77,10 @@ public class RepositorioUsuario { ...@@ -77,4 +77,10 @@ public class RepositorioUsuario {
.getResultList(); .getResultList();
} }
@Transactional(readOnly = true)
public List<Usuario> obtenerUsuariosRecientes(int limite) {
return em.createQuery("SELECT u FROM Usuario u ORDER BY u.id DESC", Usuario.class)
.setMaxResults(limite)
.getResultList();
}
} }
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