Commit 5650ac5b authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Added partner filter to institute

fixed filter when used with accession
parent b421a92e
......@@ -22,6 +22,7 @@ import java.util.Set;
import org.apache.commons.collections.CollectionUtils;
import org.genesys.blocks.model.filters.BasicModelFilter;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.model.impl.QFaoInstitute;
......@@ -49,6 +50,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit
/** The networks. */
public Set<String> networks;
/** The owner. */
public PartnerFilter owner;
/**
* Builds the query.
*
......@@ -84,6 +88,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit
and.and(institute.accessionCount.eq(0L));
}
}
if (owner != null && institute.owner != null) {
and.and(owner.buildQuery(institute.owner));
}
if (CollectionUtils.isNotEmpty(networks)) {
and.and(institute.networks.any().slug.in(networks));
......
Markdown is supported
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