Commit 6f326193 by Rubén Ramírez

fix: [Repositorio*]: Aclarado el código de los repositorios

parent d91eb063
...@@ -76,9 +76,7 @@ public class RepositorioCapitulo { ...@@ -76,9 +76,7 @@ public class RepositorioCapitulo {
@Transactional @Transactional
public void eliminarFuentePorId(Long id) { public void eliminarFuentePorId(Long id) {
FuenteCapitulo fuente = em.find(FuenteCapitulo.class, id); FuenteCapitulo fuente = em.find(FuenteCapitulo.class, id);
if (fuente != null) { if (fuente != null) em.remove(fuente);
em.remove(fuente);
}
} }
} }
...@@ -31,7 +31,7 @@ public class RepositorioRecurso { ...@@ -31,7 +31,7 @@ public class RepositorioRecurso {
"SELECT r FROM Recurso r WHERE LOWER(r.titulo) LIKE LOWER(:titulo)", "SELECT r FROM Recurso r WHERE LOWER(r.titulo) LIKE LOWER(:titulo)",
Recurso.class) Recurso.class)
.setParameter("titulo", "%" + titulo + "%") .setParameter("titulo", "%" + titulo + "%")
.setMaxResults(maxResults) // Limita la cantidad de resultados .setMaxResults(maxResults)
.getResultList(); .getResultList();
} }
...@@ -41,7 +41,7 @@ public class RepositorioRecurso { ...@@ -41,7 +41,7 @@ public class RepositorioRecurso {
"SELECT r FROM Recurso r WHERE LOWER(r.autor) LIKE LOWER(:autor)", "SELECT r FROM Recurso r WHERE LOWER(r.autor) LIKE LOWER(:autor)",
Recurso.class) Recurso.class)
.setParameter("autor", "%" + autor + "%") .setParameter("autor", "%" + autor + "%")
.setMaxResults(maxResults) // Limita la cantidad de resultados .setMaxResults(maxResults)
.getResultList(); .getResultList();
} }
...@@ -61,7 +61,7 @@ public class RepositorioRecurso { ...@@ -61,7 +61,7 @@ public class RepositorioRecurso {
Recurso.class) Recurso.class)
.setParameter("inicio", fechaInicio) .setParameter("inicio", fechaInicio)
.setParameter("fin", fechaFin) .setParameter("fin", fechaFin)
.setMaxResults(maxResults) // Limita la cantidad de resultados .setMaxResults(maxResults)
.getResultList(); .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