Skip to content

Commit

Permalink
Merge pull request #10244 from IQSS/10243-guestbook-sql-fix
Browse files Browse the repository at this point in the history
Add fix for SQL on guestbook service bean
  • Loading branch information
landreev authored Jan 19, 2024
2 parents 9f11d18 + eb6da70 commit df318f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public Long findCountByGuestbookId(Long guestbookId, Long dataverseId) {
Query query = em.createNativeQuery(queryString);
return (Long) query.getSingleResult();
} else {
String queryString = "select count(o) from GuestbookResponse as o, Dataset d, DvObject obj where o.dataset_id = d.id and d.id = obj.id and obj.owner_id = " + dataverseId + "and o.guestbook_id = " + guestbookId;
String queryString = "select count(o) from GuestbookResponse as o, Dataset d, DvObject obj where o.dataset_id = d.id and d.id = obj.id and obj.owner_id = " + dataverseId + " and o.guestbook_id = " + guestbookId;
Query query = em.createNativeQuery(queryString);
return (Long) query.getSingleResult();
}
Expand Down Expand Up @@ -914,7 +914,7 @@ public void save(GuestbookResponse guestbookResponse) {

public Long getDownloadCountByDataFileId(Long dataFileId) {
// datafile id is null, will return 0
Query query = em.createNativeQuery("select count(o.id) from GuestbookResponse o where o.datafile_id = " + dataFileId + "and eventtype != '" + GuestbookResponse.ACCESS_REQUEST +"'");
Query query = em.createNativeQuery("select count(o.id) from GuestbookResponse o where o.datafile_id = " + dataFileId + " and eventtype != '" + GuestbookResponse.ACCESS_REQUEST +"'");
return (Long) query.getSingleResult();
}

Expand Down

0 comments on commit df318f0

Please sign in to comment.