mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
DS-2180 Fix findBySubmitterDateSorted to work in metadata4all
This commit is contained in:
@@ -254,23 +254,14 @@ public class Item extends DSpaceObject
|
|||||||
*/
|
*/
|
||||||
public static ItemIterator findBySubmitterDateSorted(Context context, EPerson eperson, Integer limit) throws SQLException
|
public static ItemIterator findBySubmitterDateSorted(Context context, EPerson eperson, Integer limit) throws SQLException
|
||||||
{
|
{
|
||||||
String querySorted = "SELECT \n" +
|
String querySorted = "SELECT item.item_id, item.submitter_id, item.in_archive, item.withdrawn, " +
|
||||||
" item.item_id, \n" +
|
"item.owning_collection, item.last_modified, metadatavalue.text_value " +
|
||||||
" item.submitter_id, \n" +
|
"FROM item, metadatafieldregistry, metadatavalue " +
|
||||||
" item.in_archive, \n" +
|
"WHERE metadatafieldregistry.metadata_field_id = metadatavalue.metadata_field_id AND " +
|
||||||
" item.withdrawn, \n" +
|
" metadatavalue.resource_id = item.item_id AND " +
|
||||||
" item.owning_collection, \n" +
|
" metadatavalue.resource_type_id = ? AND " +
|
||||||
" item.last_modified, \n" +
|
" metadatafieldregistry.element = 'date' AND " +
|
||||||
" metadatavalue.text_value\n" +
|
" metadatafieldregistry.qualifier = 'accessioned' AND " +
|
||||||
"FROM \n" +
|
|
||||||
" public.item, \n" +
|
|
||||||
" public.metadatafieldregistry, \n" +
|
|
||||||
" public.metadatavalue\n" +
|
|
||||||
"WHERE \n" +
|
|
||||||
" metadatafieldregistry.metadata_field_id = metadatavalue.metadata_field_id AND\n" +
|
|
||||||
" metadatavalue.item_id = item.item_id AND\n" +
|
|
||||||
" metadatafieldregistry.element = 'date' AND \n" +
|
|
||||||
" metadatafieldregistry.qualifier = 'accessioned' AND \n" +
|
|
||||||
" item.submitter_id = ? AND \n" +
|
" item.submitter_id = ? AND \n" +
|
||||||
" item.in_archive = true\n" +
|
" item.in_archive = true\n" +
|
||||||
"ORDER BY\n" +
|
"ORDER BY\n" +
|
||||||
@@ -280,10 +271,10 @@ public class Item extends DSpaceObject
|
|||||||
|
|
||||||
if(limit != null && limit > 0) {
|
if(limit != null && limit > 0) {
|
||||||
querySorted += " limit ? ;";
|
querySorted += " limit ? ;";
|
||||||
rows = DatabaseManager.query(context, querySorted, eperson.getID(), limit);
|
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID(), limit);
|
||||||
} else {
|
} else {
|
||||||
querySorted += ";";
|
querySorted += ";";
|
||||||
rows = DatabaseManager.query(context, querySorted, eperson.getID());
|
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ItemIterator(context, rows);
|
return new ItemIterator(context, rows);
|
||||||
|
Reference in New Issue
Block a user