Skip to content

Commit c6e47b0

Browse files
committed
add notes
1 parent b68a121 commit c6e47b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ public enum VersionState {
216216
@OneToMany(mappedBy = "datasetVersion", cascade={CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST})
217217
private List<WorkflowComment> workflowComments;
218218

219+
/*
220+
* As of v6.7, the NULLS LAST part of the annotation below appears to not be working. Explicit sorting has been added in the getCurationStatuses() method. The annotation is kept since, if it does work
221+
* in the future, it is presumably more efficient that sorting in our code.
222+
*/
219223
@OneToMany(mappedBy = "datasetVersion", cascade = CascadeType.ALL, orphanRemoval = true)
220224
@OrderBy("createTime DESC NULLS LAST")
221225
private List<CurationStatus> curationStatuses = new ArrayList<>();
@@ -2160,6 +2164,11 @@ public String getLocaleLastUpdateTime() {
21602164
// Add methods to manage curationLabels
21612165
public List<CurationStatus> getCurationStatuses() {
21622166
// Sort the list to ensure null createTime values appear last
2167+
/*
2168+
* Note that the ORDER DESC NULLS LAST annotation on this list should sort this way,
2169+
* but, as of v6.7, the NULLS LAST aspect is not working.
2170+
* The code here assured both the DESC order and NULLS LAST.
2171+
*/
21632172
if (curationStatuses != null) {
21642173
curationStatuses.sort(Comparator.comparing(
21652174
CurationStatus::getCreateTime,

0 commit comments

Comments
 (0)