mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 12:33:18 +00:00
DS-2350 Fix My Submissions to support oracle for "Archived Submissions"
This commit is contained in:
@@ -293,18 +293,22 @@ public class Item extends DSpaceObject
|
|||||||
" metadatavalue.resource_type_id = ? AND " +
|
" metadatavalue.resource_type_id = ? AND " +
|
||||||
" metadatafieldregistry.element = 'date' AND " +
|
" metadatafieldregistry.element = 'date' AND " +
|
||||||
" metadatafieldregistry.qualifier = 'accessioned' AND " +
|
" metadatafieldregistry.qualifier = 'accessioned' AND " +
|
||||||
" item.submitter_id = ? AND \n" +
|
" item.submitter_id = ? AND ";
|
||||||
" item.in_archive = true\n" +
|
if(DatabaseManager.isOracle()) {
|
||||||
"ORDER BY\n" +
|
querySorted += " item.in_archive = 1 " +
|
||||||
" metadatavalue.text_value desc";
|
"ORDER BY cast(substr(metadatavalue.text_value,1,100) as varchar2(100)) desc";
|
||||||
|
} else {
|
||||||
|
querySorted += " item.in_archive = true " +
|
||||||
|
"ORDER BY metadatavalue.text_value desc";
|
||||||
|
}
|
||||||
|
|
||||||
TableRowIterator rows;
|
TableRowIterator rows;
|
||||||
|
|
||||||
if(limit != null && limit > 0) {
|
//TODO Oracle doesn't have concept of limit
|
||||||
querySorted += " limit ? ;";
|
if(limit != null && limit > 0 && !DatabaseManager.isOracle()) {
|
||||||
|
querySorted += " limit ?";
|
||||||
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID(), limit);
|
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID(), limit);
|
||||||
} else {
|
} else {
|
||||||
querySorted += ";";
|
|
||||||
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID());
|
rows = DatabaseManager.query(context, querySorted, Constants.ITEM, eperson.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user