Skip to content
Open
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 @@ -148,15 +148,15 @@ public Iterator<Bitstream> findByItem(Context context, Item item) throws SQLExce
public Iterator<Bitstream> findShowableByItem(Context context, UUID itemId, String bundleName) throws SQLException {
Query query = createQuery(
context,
"select b.id from Bitstream b " +
"join b.bundles bitBundle " +
"join bitBundle.items item " +
"select bitstream.id from Bundle bundle " +
"join bundle.items item " +
"join bundle.bitstreams bitstream " +
"WHERE item.id = :itemId " +
"and NOT EXISTS( " +
" select 1 from MetadataValue mv " +
" join mv.metadataField mf " +
" join mf.metadataSchema ms " +
" where mv.dSpaceObject = b and " +
" where mv.dSpaceObject = bitstream and " +
" ms.name = 'bitstream' and " +
" mf.element = 'hide' and " +
" mf.qualifier is null and " +
Expand All @@ -169,13 +169,14 @@ public Iterator<Bitstream> findShowableByItem(Context context, UUID itemId, Stri
" from MetadataValue mvB " +
" join mvB.metadataField mfB " +
" join mfB.metadataSchema msB " +
" where mvB.dSpaceObject = bitBundle and " +
" where mvB.dSpaceObject = bundle and " +
" msB.name = 'dc' and " +
" mfB.element = 'title' and " +
" mfB.qualifier is null and " +
" mvB.value = :bundleName " +
" )" +
")"
")" +
" ORDER BY INDEX(bitstream)"
);

query.setParameter("itemId", itemId);
Expand Down