diff --git a/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java index 4d8cd356a9..d7cc9c6079 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java @@ -128,7 +128,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO { * @return item count * @throws SQLException if database error */ - int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) + int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException; /** @@ -180,7 +181,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO { * @return count of items * @throws SQLException if database error */ - int countItems(Context context, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) throws SQLException; + int countItems(Context context, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException; /** * Count number of items from the specified submitter based on specific status flags @@ -192,7 +194,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO { * @return count of items * @throws SQLException if database error */ - int countItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) + int countItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException; } diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java index 628795f366..114254b34a 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java @@ -374,7 +374,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO implements ItemDA } @Override - public int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) + public int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException { Query query = createQuery(context, "select count(i) from Item i join i.collections c " + @@ -396,7 +397,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO implements ItemDA } Query query = createQuery(context, "select count(distinct i) from Item i " + "join i.collections collection " + - "WHERE collection IN (:collections) AND i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND discoverable=:discoverable"); + "WHERE collection IN (:collections) AND i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND " + + "discoverable=:discoverable"); query.setParameter("collections", collections); query.setParameter("in_archive", includeArchived); query.setParameter("withdrawn", includeWithdrawn); @@ -420,7 +422,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO implements ItemDA } @Override - public int countItems(Context context, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) throws SQLException { + public int countItems(Context context, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException { Query query = createQuery(context, "SELECT count(*) FROM Item i " + "WHERE i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND discoverable=:discoverable"); @@ -431,11 +434,13 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO implements ItemDA } @Override - public int countItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn, boolean discoverable) + public int countItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn, + boolean discoverable) throws SQLException { Query query = createQuery(context, "SELECT count(*) FROM Item i join i.submitter submitter " + - "WHERE i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND submitter = :submitter AND discoverable=:discoverable"); + "WHERE i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND submitter = :submitter AND " + + "discoverable=:discoverable"); query.setParameter("submitter", submitter); query.setParameter("in_archive", includeArchived); query.setParameter("withdrawn", includeWithdrawn);