Commit f4a9aed4 authored by Matija Obreza's avatar Matija Obreza

BasicModelFilter renamed #buildQuery to #buildPredicate

parent 918eb8ec
......@@ -58,7 +58,7 @@
<snippetsDirectory>${project.build.directory}/generated-snippets</snippetsDirectory>
<junit.version>4.12</junit.version>
<application.blocks.version>1.5-SNAPSHOT</application.blocks.version>
<application.blocks.version>1.6-SNAPSHOT</application.blocks.version>
<commons.beanutils.version>1.9.2</commons.beanutils.version>
<commons.collections.version>3.2.1</commons.collections.version>
<commons.io.version>2.4</commons.io.version>
......
......@@ -46,7 +46,7 @@ public class ControlledVocabularyFilter extends UuidModelFilter<ControlledVocabu
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(controlledVocabulary, controlledVocabulary._super, and);
......@@ -60,7 +60,7 @@ public class ControlledVocabularyFilter extends UuidModelFilter<ControlledVocabu
and.and(description.buildQuery(controlledVocabulary.description));
}
if (owner != null) {
and.and(controlledVocabulary.owner.in(JPAExpressions.selectFrom(QPartner.partner).where(owner.buildQuery())));
and.and(controlledVocabulary.owner.in(JPAExpressions.selectFrom(QPartner.partner).where(owner.buildPredicate())));
}
return and;
}
......
......@@ -76,7 +76,7 @@ public class DatasetFilter extends UuidModelFilter<DatasetFilter, Dataset> {
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(dataset, dataset._super, and);
......
......@@ -38,7 +38,7 @@ public class DatasetLocationFilter extends UuidModelFilter<DatasetLocationFilter
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(datasetLocation);
}
......
......@@ -99,7 +99,7 @@ public class DescriptorFilter extends UuidModelFilter<DescriptorFilter, Descript
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(descriptor);
}
......@@ -141,7 +141,7 @@ public class DescriptorFilter extends UuidModelFilter<DescriptorFilter, Descript
and.and(bibliographicCitation.buildQuery(descriptorPath.bibliographicCitation));
}
if (owner != null) {
and.and(descriptorPath.owner.in(JPAExpressions.selectFrom(QPartner.partner).where(owner.buildQuery())));
and.and(descriptorPath.owner.in(JPAExpressions.selectFrom(QPartner.partner).where(owner.buildPredicate())));
}
if (minValue != null) {
and.and(minValue.buildQuery(descriptorPath.minValue));
......@@ -150,7 +150,7 @@ public class DescriptorFilter extends UuidModelFilter<DescriptorFilter, Descript
and.and(maxValue.buildQuery(descriptorPath.maxValue));
}
if (list != null) {
and.and(descriptorPath.descriptorLists.any().in(JPAExpressions.selectFrom(QDescriptorList.descriptorList).where(list.buildQuery())));
and.and(descriptorPath.descriptorLists.any().in(JPAExpressions.selectFrom(QDescriptorList.descriptorList).where(list.buildPredicate())));
}
if (used != null) {
if (used.booleanValue()==true) {
......
......@@ -67,7 +67,7 @@ public class DescriptorListFilter extends UuidModelFilter<DescriptorListFilter,
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(descriptorList, descriptorList._super, and);
......
......@@ -52,7 +52,7 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> {
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(partner);
}
......
......@@ -390,7 +390,7 @@ public class DatasetServiceImpl implements DatasetService {
@Override
public Page<Dataset> listDatasets(final DatasetFilter filter, final Pageable page) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Dataset> res = datasetRepository.findAll(new BooleanBuilder().and(filter.buildQuery()).and(QDataset.dataset.state.in(PublishState.PUBLISHED)),
Page<Dataset> res = datasetRepository.findAll(new BooleanBuilder().and(filter.buildPredicate()).and(QDataset.dataset.state.in(PublishState.PUBLISHED)),
markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
......@@ -400,7 +400,7 @@ public class DatasetServiceImpl implements DatasetService {
*/
@Override
public long countDatasets(DatasetFilter filter) {
return datasetRepository.count(filter.buildQuery());
return datasetRepository.count(filter.buildPredicate());
}
/**
......@@ -410,12 +410,12 @@ public class DatasetServiceImpl implements DatasetService {
public Page<Dataset> listDatasetsForCurrentUser(final DatasetFilter filter, final Pageable page) {
if (securityUtils.hasRole(UserRole.ADMINISTRATOR)) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Dataset> res = datasetRepository.findAll(filter.buildQuery(), markdownSortPageRequest);
Page<Dataset> res = datasetRepository.findAll(filter.buildPredicate(), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
} else {
final HashSet<Long> partners = new HashSet<>(securityUtils.listObjectIdentityIdsForCurrentUser(Partner.class, BasePermission.WRITE));
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Dataset> res = datasetRepository.findAll(dataset.owner.id.in(partners).and(filter.buildQuery()), markdownSortPageRequest);
Page<Dataset> res = datasetRepository.findAll(dataset.owner.id.in(partners).and(filter.buildPredicate()), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
}
......
......@@ -92,7 +92,7 @@ public class DescriptorListServiceImpl implements DescriptorListService {
*/
@Override
public long countDescriptorLists(DescriptorListFilter filter) {
return descriptorListRepository.count(filter.buildQuery());
return descriptorListRepository.count(filter.buildPredicate());
}
/**
......@@ -321,7 +321,7 @@ public class DescriptorListServiceImpl implements DescriptorListService {
@Override
public Page<DescriptorList> listDescriptorLists(final DescriptorListFilter filters, final Pageable page) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<DescriptorList> res = descriptorListRepository.findAll(new BooleanBuilder().and(filters.buildQuery()).and(descriptorList.state.in(PublishState.PUBLISHED)), markdownSortPageRequest);
Page<DescriptorList> res = descriptorListRepository.findAll(new BooleanBuilder().and(filters.buildPredicate()).and(descriptorList.state.in(PublishState.PUBLISHED)), markdownSortPageRequest);
return new PageImpl<DescriptorList>(res.getContent(), page, res.getTotalElements());
}
......@@ -329,11 +329,11 @@ public class DescriptorListServiceImpl implements DescriptorListService {
public Page<DescriptorList> listDescriptorListsForCurrentUser(final DescriptorListFilter filter, final Pageable page) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
if (securityUtils.hasRole(UserRole.ADMINISTRATOR)) {
Page<DescriptorList> res = descriptorListRepository.findAll(filter.buildQuery(), markdownSortPageRequest);
Page<DescriptorList> res = descriptorListRepository.findAll(filter.buildPredicate(), markdownSortPageRequest);
return new PageImpl<DescriptorList>(res.getContent(), page, res.getTotalElements());
} else {
final HashSet<Long> partners = new HashSet<>(securityUtils.listObjectIdentityIdsForCurrentUser(Partner.class, BasePermission.WRITE));
Page<DescriptorList> res = descriptorListRepository.findAll(descriptorList.owner.id.in(partners).and(filter.buildQuery()), markdownSortPageRequest);
Page<DescriptorList> res = descriptorListRepository.findAll(descriptorList.owner.id.in(partners).and(filter.buildPredicate()), markdownSortPageRequest);
return new PageImpl<DescriptorList>(res.getContent(), page, res.getTotalElements());
}
}
......
......@@ -272,12 +272,12 @@ public class DescriptorServiceImpl implements DescriptorService {
public Page<Descriptor> listDescriptorsForCurrentUser(final DescriptorFilter filter, final Pageable page) {
if (securityUtils.hasRole(UserRole.ADMINISTRATOR)) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Descriptor> res = descriptorRepository.findAll(filter.buildQuery(), markdownSortPageRequest);
Page<Descriptor> res = descriptorRepository.findAll(filter.buildPredicate(), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
} else {
final HashSet<Long> partners = new HashSet<>(securityUtils.listObjectIdentityIdsForCurrentUser(Partner.class, BasePermission.WRITE));
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Descriptor> res = descriptorRepository.findAll(descriptor.owner.id.in(partners).and(filter.buildQuery()), markdownSortPageRequest);
Page<Descriptor> res = descriptorRepository.findAll(descriptor.owner.id.in(partners).and(filter.buildPredicate()), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
}
......@@ -290,7 +290,7 @@ public class DescriptorServiceImpl implements DescriptorService {
} else {
final HashSet<Long> partners = new HashSet<>(securityUtils.listObjectIdentityIdsForCurrentUser(Partner.class, BasePermission.WRITE));
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Descriptor> res = descriptorRepository.findAll(QDescriptor.descriptor.state.in(PublishState.PUBLISHED).or(descriptor.owner.id.in(partners)).and(descriptorFilter.buildQuery()), markdownSortPageRequest);
Page<Descriptor> res = descriptorRepository.findAll(QDescriptor.descriptor.state.in(PublishState.PUBLISHED).or(descriptor.owner.id.in(partners)).and(descriptorFilter.buildPredicate()), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
}
......@@ -301,7 +301,7 @@ public class DescriptorServiceImpl implements DescriptorService {
@Override
public Page<Descriptor> listDescriptors(final DescriptorFilter descriptorFilter, final Pageable page) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "title");
Page<Descriptor> res = descriptorRepository.findAll(new BooleanBuilder().and(descriptorFilter.buildQuery()).and(QDescriptor.descriptor.state.in(PublishState.PUBLISHED)), markdownSortPageRequest);
Page<Descriptor> res = descriptorRepository.findAll(new BooleanBuilder().and(descriptorFilter.buildPredicate()).and(QDescriptor.descriptor.state.in(PublishState.PUBLISHED)), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
......@@ -524,14 +524,14 @@ public class DescriptorServiceImpl implements DescriptorService {
@Override
public void exportDescriptors(DescriptorFilter filter, OutputStream outputStream) throws IOException {
List<Descriptor> descriptors = (List<Descriptor>) descriptorRepository
.findAll(filter.buildQuery());
.findAll(filter.buildPredicate());
downloadService.writeXlsxDescriptor(descriptors, outputStream);
}
@Override
public long countDescriptors(DescriptorFilter filter) {
return descriptorRepository.count(filter.buildQuery());
return descriptorRepository.count(filter.buildPredicate());
}
}
......@@ -162,12 +162,12 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
public Page<Partner> listPartnersForCurrentUser(final PartnerFilter filter, final Pageable page) {
if (securityUtils.hasRole(UserRole.ADMINISTRATOR)) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "name");
Page<Partner> res = partnerRepository.findAll(filter.buildQuery(), markdownSortPageRequest);
Page<Partner> res = partnerRepository.findAll(filter.buildPredicate(), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
} else {
final HashSet<Long> ids = new HashSet<>(securityUtils.listObjectIdentityIdsForCurrentUser(Partner.class, BasePermission.WRITE));
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "name");
Page<Partner> res = partnerRepository.findAll(partner.id.in(ids).and(filter.buildQuery()), markdownSortPageRequest);
Page<Partner> res = partnerRepository.findAll(partner.id.in(ids).and(filter.buildPredicate()), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
}
......@@ -178,7 +178,7 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
@Override
public Page<Partner> listPartners(final PartnerFilter partnerFilter, final Pageable page) {
Pageable markdownSortPageRequest = JPAUtils.toMarkdownSort(page, "name");
Page<Partner> res = partnerRepository.findAll(partnerFilter.buildQuery(), markdownSortPageRequest);
Page<Partner> res = partnerRepository.findAll(partnerFilter.buildPredicate(), markdownSortPageRequest);
return new PageImpl<>(res.getContent(), page, res.getTotalElements());
}
......@@ -225,7 +225,7 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
@Override
public Page<FaoInstitute> loadPartnerInstitutes(UUID uuid, InstituteFilter filter, Pageable page) {
return instituteRepository.findAll(QFaoInstitute.faoInstitute.owner.uuid.eq(uuid).and(filter.buildQuery()), page);
return instituteRepository.findAll(QFaoInstitute.faoInstitute.owner.uuid.eq(uuid).and(filter.buildPredicate()), page);
}
/**
......@@ -279,7 +279,7 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
@Override
public long countPartners(PartnerFilter filter) {
return partnerRepository.count(filter.buildQuery());
return partnerRepository.count(filter.buildPredicate());
}
/**
......
......@@ -231,7 +231,7 @@ public class VocabularyServiceImpl implements VocabularyService {
@Override
public Page<ControlledVocabulary> listVocabularies(final ControlledVocabularyFilter filters, final Pageable page) {
return vocabRepository.findAll(filters.buildQuery(), page);
return vocabRepository.findAll(filters.buildPredicate(), page);
}
@Override
......
......@@ -77,4 +77,12 @@ public interface AccessionRepositoryCustom {
* @return the list
*/
List<Accession> findAll(AccessionFilter filter, Pageable page);
/**
* Count accessions matching filter
*
* @param filter the filter
* @return the long
*/
long count(AccessionFilter filter);
}
......@@ -32,7 +32,6 @@ import javax.persistence.criteria.Join;
import javax.persistence.criteria.Path;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.Selection;
import org.apache.commons.lang3.time.StopWatch;
import org.genesys2.server.model.genesys.Accession;
......@@ -50,7 +49,6 @@ import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.support.Querydsl;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.querydsl.core.types.dsl.PathBuilder;
......@@ -210,19 +208,29 @@ public class AccessionRepositoryCustomImpl implements AccessionRepositoryCustom,
JPAQuery<Accession> query = jpaQueryFactory.selectFrom(QAccession.accession).distinct().where(QAccession.accession.accessionId.uuid.in(accessionUuids));
return query.fetch();
}
@Override
public long count(AccessionFilter filter) {
Querydsl querydsl = new Querydsl(em, pathBuilder);
QAccession qAccession = QAccession.accession;
JPQLQuery<Object> query = querydsl.createQuery(qAccession);
filter.buildJpaQuery(query, qAccession);
return query.fetchCount();
}
@Override
public List<Accession> findAll(AccessionFilter filter, Pageable page) {
Querydsl querydsl = new Querydsl(em, pathBuilder);
JPQLQuery<Accession> query = querydsl.createQuery(QAccession.accession).select(QAccession.accession);
QAccession qAccession = QAccession.accession;
JPQLQuery<Object> query = querydsl.createQuery(qAccession);
filter.buildJpaQuery(query, qAccession);
if (filter != null) {
// apply filter
query.where(filter.buildQuery());
}
querydsl.applyPagination(page, query);
querydsl.applySorting(page.getSort(), query);
return query.fetch();
return query.select(qAccession).fetch();
}
}
......@@ -16,6 +16,7 @@
package org.genesys2.server.service;
import java.io.IOException;
import java.util.List;
import org.genesys2.server.model.elastic.AccessionDetails;
......@@ -43,7 +44,7 @@ public interface GenesysFilterService {
void listGeoTile(boolean distinct, AppliedFilters filters, Integer limit, int zoom, int xtile, int ytile, RowCallbackHandler rowHandler);
List<Double[]> listGeoTile(AccessionFilter filter, Integer limit, int zoom, int xtile, int ytile);
List<Double[]> listGeoTile(AccessionFilter filter, Integer limit, int zoom, int xtile, int ytile) throws IOException;
AppliedFilters transformFiltersIfNeed(AppliedFilters appliedFilters);
}
......@@ -66,6 +66,7 @@ public interface MappingService {
* @param ytile
* the ytile
* @return the tile
* @throws IOException
*/
byte[] getTile(AccessionFilter filter, int zoom, int xtile, int ytile);
byte[] getTile(AccessionFilter filter, int zoom, int xtile, int ytile) throws IOException;
}
......@@ -49,7 +49,7 @@ public class AccessionCollectFilter extends BasicModelFilter<AccessionCollectFil
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(accessionCollect);
}
......@@ -61,7 +61,7 @@ public class AccessionCollectFilter extends BasicModelFilter<AccessionCollectFil
*/
public Predicate buildQuery(QAccessionCollect collect) {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(collect, collect._super, and);
super.buildPredicate(collect, collect._super, and);
if (date != null) {
and.and(date.buildQuery(collect.collDate));
......
......@@ -24,10 +24,19 @@ import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.blocks.model.filters.UuidModelFilter;
import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.QAccession;
import org.genesys2.server.model.genesys.QAccessionCollect;
import org.genesys2.server.model.genesys.QAccessionGeo;
import org.genesys2.server.model.genesys.QAccessionId;
import org.genesys2.server.model.genesys.QPDCI;
import org.genesys2.server.model.genesys.QTaxonomy2;
import org.genesys2.server.model.impl.QCountry;
import org.genesys2.server.model.impl.QCrop;
import org.genesys2.server.model.impl.QFaoInstitute;
import com.hazelcast.util.CollectionUtil;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.JPQLQuery;
/**
* Filters for {@link Accession}.
......@@ -103,10 +112,115 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
/* (non-Javadoc)
* @see org.genesys.blocks.model.filters.BasicModelFilter#buildQuery()
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(QAccession.accession);
}
public <T> JPQLQuery<T> buildJpaQuery(JPQLQuery<T> query, QAccession accession) {
QAccessionId qAccessionId = new QAccessionId("accessionId");
query.innerJoin(accession.accessionId, qAccessionId);
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(accession, accession._super._super, and);
if (taxa != null) {
QTaxonomy2 qTaxonomy = new QTaxonomy2("taxonomy");
query.innerJoin(accession.taxonomy, qTaxonomy);
and.and(taxa.buildQuery(qTaxonomy));
}
if (crop != null && !crop.isEmpty()) {
QCrop qCrop = new QCrop("crop");
query.leftJoin(accession.crop, qCrop);
and.and(qCrop.shortName.in(crop));
}
if (holder != null) {
QFaoInstitute qInstitute = new QFaoInstitute("institute");
query.innerJoin(accession.institute, qInstitute);
and.and(holder.buildQuery(qInstitute));
}
if (origin != null) {
QCountry qOrigin = new QCountry("countryOfOrigin");
query.leftJoin(accession.countryOfOrigin, qOrigin);
and.and(origin.buildQuery(qOrigin));
}
if (geo != null) {
QAccessionGeo qGeo = new QAccessionGeo("geo");
query.leftJoin(qAccessionId.geo, qGeo);
and.and(geo.buildQuery(qGeo));
}
if (coll != null) {
QAccessionCollect qColl = new QAccessionCollect("coll");
query.leftJoin(qAccessionId.coll, qColl);
and.and(coll.buildQuery(qColl));
}
if (pdci != null) {
QPDCI qPdci = new QPDCI("pdci");
query.leftJoin(qAccessionId.pdci, qPdci);
and.and(pdci.buildQuery(qPdci.score));
}
// Fields
if (historic != null) {
and.and(accession.historic.eq(historic));
}
if (cropName != null) {
and.and(accession.cropName.eq(cropName));
}
if (CollectionUtil.isNotEmpty(doi)) {
and.and(accession.doi.in(doi));
}
if (acceNumb != null) {
and.and(acceNumb.buildQuery(accession.accessionNumber));
}
if (seqNo != null) {
and.and(seqNo.buildQuery(accession.seqNo));
}
if (CollectionUtil.isNotEmpty(sampStat)) {
and.and(accession.sampStat.in(sampStat));
}
if (CollectionUtil.isNotEmpty(storage)) {
and.and(qAccessionId.storage.any().in(storage));
}
if (mlsStatus != null) {
and.and(accession.mlsStatus.eq(mlsStatus));
}
if (available != null) {
and.and(accession.available.eq(available));
}
if (art15 != null) {
and.and(accession.inTrust.eq(art15));
}
if (CollectionUtil.isNotEmpty(list)) {
and.and(qAccessionId.lists.any().uuid.in(list));
}
if (CollectionUtil.isNotEmpty(uuid)) {
and.and(qAccessionId.uuid.in(uuid));
}
if (alias != null) {
and.and(alias.buildQuery(accession.accessionId.aliases.any().name));
}
// TODO Do we have to change this?
if (sgsv != null) {
if (sgsv == Boolean.TRUE) {
and.and(qAccessionId.duplSite.any().eq("NOR051"));
} else {
and.andNot(qAccessionId.duplSite.any().eq("NOR051"));
}
}
if (images != null) {
if (images == Boolean.TRUE) {
and.and(qAccessionId.imageCount.gt(0));
} else {
and.and(qAccessionId.imageCount.eq(0));
}
}
query.where(and);
return query;
}
/**
* Builds the query.
*
......
......@@ -49,7 +49,7 @@ public class AccessionGeoFilter extends BasicModelFilter<AccessionGeoFilter, Acc
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(accessionGeo);
}
......@@ -61,7 +61,7 @@ public class AccessionGeoFilter extends BasicModelFilter<AccessionGeoFilter, Acc
*/
public Predicate buildQuery(QAccessionGeo accessiongeo) {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(accessiongeo, accessiongeo._super, and);
super.buildPredicate(accessiongeo, accessiongeo._super, and);
if (referenced != null) {
if (referenced.booleanValue()) {
......
......@@ -38,7 +38,7 @@ public class ActivityPostFilter extends AuditedVersionedModelFilter<ActivityPost
public String _text;
@Override
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(activityPost);
}
......
......@@ -46,7 +46,7 @@ public class ArticleFilter extends AuditedVersionedModelFilter<ArticleFilter, Ar
public Boolean template;
@Override
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(article);
}
......@@ -57,7 +57,7 @@ public class ArticleFilter extends AuditedVersionedModelFilter<ArticleFilter, Ar
*/
public Predicate buildQuery(QArticle article) {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(article, article._super._super._super, and);
super.buildPredicate(article, article._super._super._super, and);
if (CollectionUtil.isNotEmpty(lang)) {
and.and(article.lang.in(lang));
......
......@@ -45,7 +45,7 @@ public class CountryFilter extends BasicModelFilter<CountryFilter, Country> {
*
* @return the predicate
*/
public Predicate buildQuery() {
public Predicate buildPredicate() {
return buildQuery(country);
}
......@@ -57,7 +57,7 @@ public class CountryFilter extends BasicModelFilter<CountryFilter, Country> {
*/
public Predicate buildQuery(QCountry country) {
final BooleanBuilder and = new BooleanBuilder();
super.buildQuery(country, country._super, and);
super.buildPredicate(country, country._super, and);
if (iso3 != null && !iso3.isEmpty()) {
and.and(country.code3.in(iso3));
......
......@@ -37,7 +37,7 @@ public class GeoRegionFilter extends BasicModelFilter<GeoRegionFilter, GeoRegion
*
* @return the predicate
*/
public Predicate buildQuery() {