[DURACOM-125][#8736] Preserved order of modified MetadataValues

feat:
  - Introduced new Class with static methods usable to order
`MetadataValue` lists;
  - Introduced ITs also for `PatchMetadata` replace operations;
  - Introduced new method `DspaceObject#getMetadataFieldId`.
ref:
  - Replaced old sort method inside `ItemServiceImpl` with the new one
This commit is contained in:
Vincenzo Mecca
2023-03-24 17:34:02 +01:00
parent 882373faa1
commit b1c1edc7f0
6 changed files with 203 additions and 93 deletions

View File

@@ -19,6 +19,7 @@ import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.dspace.core.Context;
import org.dspace.core.ReloadableEntity;
@@ -171,6 +172,14 @@ public class MetadataValue implements ReloadableEntity<Integer> {
this.metadataField = metadataField;
}
/**
* @return {@code MetadataField#getID()}
*/
@Transient
protected Integer getMetadataFieldId() {
return getMetadataField().getID();
}
/**
* Get the metadata value.
*