Skip to content

Commit

Permalink
refactor(dao): LetterSoundCorrespondenceContributionEvent#letterSounds
Browse files Browse the repository at this point in the history
refs #1677
  • Loading branch information
jo-elimu committed Jul 13, 2024
1 parent 05cc2b5 commit 613bfc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public List<LetterSoundCorrespondenceContributionEvent> readAll(LetterSoundCorre
return em.createQuery(
"SELECT e " +
"FROM LetterSoundCorrespondenceContributionEvent e " +
"WHERE e.letterSoundCorrespondence = :letterSoundCorrespondence " +
"WHERE e.letterSound = :letterSound " +
"ORDER BY e.time DESC")
.setParameter("letterSoundCorrespondence", letterSound)
.setParameter("letterSound", letterSound)
.getResultList();
}

Expand All @@ -45,7 +45,7 @@ public List<LetterSoundCorrespondenceContributionEvent> readMostRecentPerLetterS
return em.createQuery(
"SELECT e " +
"FROM LetterSoundCorrespondenceContributionEvent e " +
"WHERE e.time IN (SELECT MAX(time) FROM LetterSoundCorrespondenceContributionEvent GROUP BY letterSoundCorrespondence_id) " + // TODO: replace with "NOT EXISTS"? - https://stackoverflow.com/a/25694562
"WHERE e.time IN (SELECT MAX(time) FROM LetterSoundCorrespondenceContributionEvent GROUP BY letterSound_id) " + // TODO: replace with "NOT EXISTS"? - https://stackoverflow.com/a/25694562
"ORDER BY e.time ASC")
.getResultList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public List<LetterSoundCorrespondencePeerReviewEvent> readAll(LetterSoundCorresp
return em.createQuery(
"SELECT event " +
"FROM LetterSoundCorrespondencePeerReviewEvent event " +
"WHERE event.letterSoundCorrespondenceContributionEvent.letterSoundCorrespondence = :letterSoundCorrespondence " +
"WHERE event.letterSoundCorrespondenceContributionEvent.letterSound = :letterSound " +
"ORDER BY event.time DESC")
.setParameter("letterSoundCorrespondence", letterSound)
.setParameter("letterSound", letterSound)
.getResultList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</thead>
<tbody>
<c:forEach var="letterSoundContributionEvent" items="${letterSoundContributionEventsPendingPeerReview}">
<c:set var="letterSound" value="${letterSoundContributionEvent.letterSoundCorrespondence}" />
<c:set var="letterSound" value="${letterSoundContributionEvent.letterSound}" />
<tr>
<td style="font-size: 2em;">
" <c:forEach var="letter" items="${letterSound.letters}"><a href="<spring:url value='/content/letter/edit/${letter.id}' />">${letter.text} </a> </c:forEach> "
Expand Down Expand Up @@ -68,7 +68,7 @@
<fmt:formatDate value="${letterSoundContributionEvent.time.time}" pattern="yyyy-MM-dd HH:mm" />
</td>
<td>
<a href="<spring:url value='/content/letter-sound/edit/${letterSoundContributionEvent.letterSoundCorrespondence.id}#peer-review' />" target="_blank"><fmt:message key="peer.review" /></a>
<a href="<spring:url value='/content/letter-sound/edit/${letterSoundContributionEvent.letterSound.id}#peer-review' />" target="_blank"><fmt:message key="peer.review" /></a>
</td>
</tr>
</c:forEach>
Expand Down

0 comments on commit 613bfc7

Please sign in to comment.