mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
Merge remote-tracking branch 'origin/refactor_item_counter' into refactor_item_counter
This commit is contained in:
@@ -128,7 +128,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO<Item> {
|
|||||||
* @return item count
|
* @return item count
|
||||||
* @throws SQLException if database error
|
* @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;
|
throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -180,7 +181,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO<Item> {
|
|||||||
* @return count of items
|
* @return count of items
|
||||||
* @throws SQLException if database error
|
* @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
|
* Count number of items from the specified submitter based on specific status flags
|
||||||
@@ -192,7 +194,8 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO<Item> {
|
|||||||
* @return count of items
|
* @return count of items
|
||||||
* @throws SQLException if database error
|
* @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;
|
throws SQLException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -374,7 +374,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO<Item> implements ItemDA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 {
|
throws SQLException {
|
||||||
Query query = createQuery(context,
|
Query query = createQuery(context,
|
||||||
"select count(i) from Item i join i.collections c " +
|
"select count(i) from Item i join i.collections c " +
|
||||||
@@ -396,7 +397,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO<Item> implements ItemDA
|
|||||||
}
|
}
|
||||||
Query query = createQuery(context, "select count(distinct i) from Item i " +
|
Query query = createQuery(context, "select count(distinct i) from Item i " +
|
||||||
"join i.collections collection " +
|
"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("collections", collections);
|
||||||
query.setParameter("in_archive", includeArchived);
|
query.setParameter("in_archive", includeArchived);
|
||||||
query.setParameter("withdrawn", includeWithdrawn);
|
query.setParameter("withdrawn", includeWithdrawn);
|
||||||
@@ -420,7 +422,8 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO<Item> implements ItemDA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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,
|
Query query = createQuery(context,
|
||||||
"SELECT count(*) FROM Item i " +
|
"SELECT count(*) FROM Item i " +
|
||||||
"WHERE i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND discoverable=:discoverable");
|
"WHERE i.inArchive=:in_archive AND i.withdrawn=:withdrawn AND discoverable=:discoverable");
|
||||||
@@ -431,11 +434,13 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO<Item> implements ItemDA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 {
|
throws SQLException {
|
||||||
Query query = createQuery(context,
|
Query query = createQuery(context,
|
||||||
"SELECT count(*) FROM Item i join i.submitter submitter " +
|
"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("submitter", submitter);
|
||||||
query.setParameter("in_archive", includeArchived);
|
query.setParameter("in_archive", includeArchived);
|
||||||
query.setParameter("withdrawn", includeWithdrawn);
|
query.setParameter("withdrawn", includeWithdrawn);
|
||||||
|
Reference in New Issue
Block a user