Merge pull request #1191 from atmire/DS-2916

DS-2916 BitstreamDAOImpl contains incorrect database linking
This commit is contained in:
Kevin Van de Velde
2015-12-01 13:46:33 +01:00

View File

@@ -77,8 +77,7 @@ public class BitstreamDAOImpl extends AbstractHibernateDSODAO<Bitstream> impleme
public Iterator<Bitstream> findByCommunity(Context context, Community community) throws SQLException { public Iterator<Bitstream> findByCommunity(Context context, Community community) throws SQLException {
Query query = createQuery(context, "select b from Bitstream b " + Query query = createQuery(context, "select b from Bitstream b " +
"join b.bundles bitBundles " + "join b.bundles bitBundles " +
"join bitBundles.bundle bundle " + "join bitBundles.items item " +
"join bundle.items item " +
"join item.collections itemColl " + "join item.collections itemColl " +
"join itemColl.communities community " + "join itemColl.communities community " +
"WHERE :community IN community"); "WHERE :community IN community");
@@ -92,8 +91,7 @@ public class BitstreamDAOImpl extends AbstractHibernateDSODAO<Bitstream> impleme
public Iterator<Bitstream> findByCollection(Context context, Collection collection) throws SQLException { public Iterator<Bitstream> findByCollection(Context context, Collection collection) throws SQLException {
Query query = createQuery(context, "select b from Bitstream b " + Query query = createQuery(context, "select b from Bitstream b " +
"join b.bundles bitBundles " + "join b.bundles bitBundles " +
"join bitBundles.bundle bundle " + "join bitBundles.items item " +
"join bundle.items item " +
"join item.collections c " + "join item.collections c " +
"WHERE :collection IN c"); "WHERE :collection IN c");
@@ -106,8 +104,7 @@ public class BitstreamDAOImpl extends AbstractHibernateDSODAO<Bitstream> impleme
public Iterator<Bitstream> findByItem(Context context, Item item) throws SQLException { public Iterator<Bitstream> findByItem(Context context, Item item) throws SQLException {
Query query = createQuery(context, "select b from Bitstream b " + Query query = createQuery(context, "select b from Bitstream b " +
"join b.bundles bitBundles " + "join b.bundles bitBundles " +
"join bitBundles.bundle bundle " + "join bitBundles.items item " +
"join bundle.items item " +
"WHERE :item IN item"); "WHERE :item IN item");
query.setParameter("item", item); query.setParameter("item", item);