Commit 33f36d56 authored by Matija Obreza's avatar Matija Obreza
Browse files

Don't join FaoInstitute if not needed, avoid NPE in #sort

parent 1896e3d0
......@@ -108,11 +108,11 @@ public class DirectMysqlQuery {
}
}
// if (hasFilter(filters, FilterConstants.ORGCTY_ISO3)) {
// innerJoin("country", "cty", "cty.id=a.orgCtyId");
// }
// if (hasFilter(filters, FilterConstants.ORGCTY_ISO3)) {
// innerJoin("country", "cty", "cty.id=a.orgCtyId");
// }
if (hasFilter(filters, FilterConstants.INSTCODE) || hasFilter(filters, FilterConstants.INSTITUTE_COUNTRY_ISO3)
if (/* hasFilter(filters, FilterConstants.INSTCODE) || */hasFilter(filters, FilterConstants.INSTITUTE_COUNTRY_ISO3)
|| hasFilter(filters, FilterConstants.INSTITUTE_NETWORK)) {
innerJoin("faoinstitute", "fao", "fao.id=a.instituteId");
......@@ -421,6 +421,10 @@ public class DirectMysqlQuery {
}
public DirectMysqlQuery sort(Sort sort) {
if (sort == null) {
return this;
}
if (sortBuffer.length() != 0) {
throw new RuntimeException("sortBuffer is not blank, invalid use of #pageable(Pageable)");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment