Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,15 @@ public int countDeleted(Context context) throws SQLException {
@Override
public int countWithNoPolicy(Context context) throws SQLException {
Query query = createQuery(context,
"SELECT count(bit.id) from Bitstream bit where bit.deleted<>true and bit.id not in" +
" (select res.dSpaceObject from ResourcePolicy res where res.resourceTypeId = " +
":typeId )");
"SELECT count(bit.id) " +
"FROM Bitstream bit " +
"WHERE bit.deleted <> true " +
"AND NOT EXISTS (" +
" SELECT 1 FROM ResourcePolicy res " +
" WHERE res.resourceTypeId = :typeId " +
" AND res.dSpaceObject.id = bit.id" +
")"
);
query.setParameter("typeId", Constants.BITSTREAM);
return count(query);
}
Expand Down