Commit 377e2732 authored by Matija Obreza's avatar Matija Obreza
Browse files

Caching: Caching with HZ requires serializable filters

parent e081cc41
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.genesys2.server.service; package org.genesys2.server.service;
import java.beans.Transient; import java.beans.Transient;
import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -157,7 +158,8 @@ public interface ElasticsearchService { ...@@ -157,7 +158,8 @@ public interface ElasticsearchService {
*/ */
List<Object[]> aggregateDate(int size, Class<? extends EmptyModel> targetClass, Class<? extends EmptyModel> indexClass, String aggregatedDateField, String groupingByField, EmptyModelFilter<?, ?> filter) throws SearchException; List<Object[]> aggregateDate(int size, Class<? extends EmptyModel> targetClass, Class<? extends EmptyModel> indexClass, String aggregatedDateField, String groupingByField, EmptyModelFilter<?, ?> filter) throws SearchException;
public static class TermResult { public static class TermResult implements Serializable {
private static final long serialVersionUID = -6646063484562660447L;
private final List<Term> terms; private final List<Term> terms;
private final Long total; private final Long total;
private final long other; private final long other;
...@@ -197,7 +199,8 @@ public interface ElasticsearchService { ...@@ -197,7 +199,8 @@ public interface ElasticsearchService {
} }
} }
public static class Term { public static class Term implements Serializable {
private static final long serialVersionUID = -4161698220975370044L;
private final String term; private final String term;
private final long count; private final long count;
...@@ -215,7 +218,8 @@ public interface ElasticsearchService { ...@@ -215,7 +218,8 @@ public interface ElasticsearchService {
} }
} }
public static class TreeNode { public static class TreeNode implements Serializable {
private static final long serialVersionUID = 4878674372987777983L;
public String groupBy; // ES aggregation group public String groupBy; // ES aggregation group
public String name; // term value public String name; // term value
public long value; // term count public long value; // term count
......
...@@ -31,6 +31,8 @@ import static org.genesys2.server.model.genesys.QAccessionCollect.accessionColle ...@@ -31,6 +31,8 @@ import static org.genesys2.server.model.genesys.QAccessionCollect.accessionColle
*/ */
public class AccessionCollectFilter extends BasicModelFilter<AccessionCollectFilter, AccessionCollect> { public class AccessionCollectFilter extends BasicModelFilter<AccessionCollectFilter, AccessionCollect> {
private static final long serialVersionUID = -7202993524291195666L;
/** The date. */ /** The date. */
public StringFilter collDate; public StringFilter collDate;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package org.genesys2.server.service.filter; package org.genesys2.server.service.filter;
import java.io.Serializable;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -53,7 +52,7 @@ import com.querydsl.jpa.JPQLQuery; ...@@ -53,7 +52,7 @@ import com.querydsl.jpa.JPQLQuery;
/** /**
* Filters for {@link Accession}. * Filters for {@link Accession}.
*/ */
public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession> implements Serializable, IFullTextFilter { public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession> implements IFullTextFilter {
private static final long serialVersionUID = -1441103961567816877L; private static final long serialVersionUID = -1441103961567816877L;
......
...@@ -31,6 +31,8 @@ import org.genesys2.server.model.genesys.QAccessionId; ...@@ -31,6 +31,8 @@ import org.genesys2.server.model.genesys.QAccessionId;
*/ */
public class AccessionGeoFilter extends BasicModelFilter<AccessionGeoFilter, AccessionId> { public class AccessionGeoFilter extends BasicModelFilter<AccessionGeoFilter, AccessionId> {
private static final long serialVersionUID = 1456709522018735306L;
/** The longitude. */ /** The longitude. */
public NumberFilter<Double> longitude; public NumberFilter<Double> longitude;
......
...@@ -37,6 +37,8 @@ import com.querydsl.core.types.Predicate; ...@@ -37,6 +37,8 @@ import com.querydsl.core.types.Predicate;
*/ */
public class ActivityPostFilter extends AuditedVersionedModelFilter<ActivityPostFilter, ActivityPost> { public class ActivityPostFilter extends AuditedVersionedModelFilter<ActivityPostFilter, ActivityPost> {
private static final long serialVersionUID = -1246756715587196499L;
/** Any text. */ /** Any text. */
public String _text; public String _text;
......
...@@ -33,6 +33,8 @@ import static org.genesys2.server.model.impl.QArticle.article; ...@@ -33,6 +33,8 @@ import static org.genesys2.server.model.impl.QArticle.article;
*/ */
public class ArticleFilter extends AuditedVersionedModelFilter<ArticleFilter, Article> implements IFullTextFilter { public class ArticleFilter extends AuditedVersionedModelFilter<ArticleFilter, Article> implements IFullTextFilter {
private static final long serialVersionUID = 7789481885424249762L;
/** Any text. */ /** Any text. */
public String _text; public String _text;
......
...@@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.genesys.blocks.model.filters.NumberFilter; import org.genesys.blocks.model.filters.NumberFilter;
import org.genesys2.server.model.impl.QTileClimate; import org.genesys2.server.model.impl.QTileClimate;
import java.io.Serializable;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -27,7 +28,9 @@ import java.util.Set; ...@@ -27,7 +28,9 @@ import java.util.Set;
/** /**
* The Class ClimateFilter. * The Class ClimateFilter.
*/ */
public class ClimateFilter { public class ClimateFilter implements Serializable {
private static final long serialVersionUID = -8738935142977143553L;
/** The latitude. */ /** The latitude. */
public Set<Long> tileIndex; public Set<Long> tileIndex;
......
...@@ -34,6 +34,8 @@ import org.genesys2.server.model.grin.QCooperatorOwnedModel; ...@@ -34,6 +34,8 @@ import org.genesys2.server.model.grin.QCooperatorOwnedModel;
*/ */
public abstract class CooperatorOwnedModelFilter<T extends CooperatorOwnedModelFilter<T, R>, R extends CooperatorOwnedModel> extends EmptyModelFilter<T, R> { public abstract class CooperatorOwnedModelFilter<T extends CooperatorOwnedModelFilter<T, R>, R extends CooperatorOwnedModel> extends EmptyModelFilter<T, R> {
private static final long serialVersionUID = -109063330449548848L;
/** The created by. */ /** The created by. */
public Set<Long> createdBy; public Set<Long> createdBy;
......
...@@ -33,6 +33,8 @@ import static org.genesys2.server.model.impl.QCountry.country; ...@@ -33,6 +33,8 @@ import static org.genesys2.server.model.impl.QCountry.country;
*/ */
public class CountryFilter extends BasicModelFilter<CountryFilter, Country> { public class CountryFilter extends BasicModelFilter<CountryFilter, Country> {
private static final long serialVersionUID = 2709549285697195920L;
/** The iso 3. */ /** The iso 3. */
public Set<String> code3; public Set<String> code3;
......
...@@ -35,6 +35,8 @@ import org.genesys2.server.model.impl.QDiversityTree; ...@@ -35,6 +35,8 @@ import org.genesys2.server.model.impl.QDiversityTree;
*/ */
public class DiversityTreeFilter extends UuidModelFilter<DiversityTreeFilter, DiversityTree> implements IFullTextFilter { public class DiversityTreeFilter extends UuidModelFilter<DiversityTreeFilter, DiversityTree> implements IFullTextFilter {
private static final long serialVersionUID = 3948516024666269840L;
/** Any text. */ /** Any text. */
public String _text; public String _text;
......
...@@ -28,6 +28,8 @@ import java.util.Set; ...@@ -28,6 +28,8 @@ import java.util.Set;
*/ */
public class GeoRegionFilter extends BasicModelFilter<GeoRegionFilter, GeoRegion> { public class GeoRegionFilter extends BasicModelFilter<GeoRegionFilter, GeoRegion> {
private static final long serialVersionUID = 4573603969853597998L;
/** The region code. */ /** The region code. */
public Set<String> isoCode; public Set<String> isoCode;
......
...@@ -34,12 +34,13 @@ import org.genesys2.server.service.PGRFANetworkService; ...@@ -34,12 +34,13 @@ import org.genesys2.server.service.PGRFANetworkService;
import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonGetter;
import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Predicate;
// TODO: Auto-generated Javadoc
/** /**
* Filter for {@link FaoInstitute}. * Filter for {@link FaoInstitute}.
*/ */
public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstitute> { public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstitute> {
private static final long serialVersionUID = 4754504385073612669L;
/** The code. */ /** The code. */
public Set<String> code; public Set<String> code;
......
...@@ -31,12 +31,13 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; ...@@ -31,12 +31,13 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.deser.std.UUIDDeserializer; import com.fasterxml.jackson.databind.deser.std.UUIDDeserializer;
import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Predicate;
// TODO: Auto-generated Javadoc
/** /**
* Filter for {@link MaterialRequest}. * Filter for {@link MaterialRequest}.
*/ */
public class MaterialRequestFilter extends AuditedVersionedModelFilter<MaterialRequestFilter, MaterialRequest> { public class MaterialRequestFilter extends AuditedVersionedModelFilter<MaterialRequestFilter, MaterialRequest> {
private static final long serialVersionUID = 6134952253212911002L;
/** The identifiers. */ /** The identifiers. */
@JsonDeserialize(contentUsing = UUIDDeserializer.class) @JsonDeserialize(contentUsing = UUIDDeserializer.class)
......
...@@ -34,12 +34,13 @@ import java.util.stream.Collectors; ...@@ -34,12 +34,13 @@ import java.util.stream.Collectors;
import static org.genesys2.server.model.genesys.QMaterialSubRequest.materialSubRequest; import static org.genesys2.server.model.genesys.QMaterialSubRequest.materialSubRequest;
// TODO: Auto-generated Javadoc
/** /**
* Filter for {@link MaterialSubRequest}. * Filter for {@link MaterialSubRequest}.
*/ */
public class MaterialSubRequestFilter extends AuditedVersionedModelFilter<MaterialSubRequestFilter, MaterialSubRequest> { public class MaterialSubRequestFilter extends AuditedVersionedModelFilter<MaterialSubRequestFilter, MaterialSubRequest> {
private static final long serialVersionUID = -5287959314678817864L;
/** The identifiers. */ /** The identifiers. */
@JsonDeserialize(contentUsing = UUIDDeserializer.class) @JsonDeserialize(contentUsing = UUIDDeserializer.class)
public Set<UUID> uuid; public Set<UUID> uuid;
......
...@@ -35,6 +35,8 @@ import org.genesys2.server.model.impl.User; ...@@ -35,6 +35,8 @@ import org.genesys2.server.model.impl.User;
*/ */
public class OAuthClientFilter extends AuditedVersionedModelFilter<OAuthClientFilter, OAuthClient> { public class OAuthClientFilter extends AuditedVersionedModelFilter<OAuthClientFilter, OAuthClient> {
private static final long serialVersionUID = 6266936735191280437L;
/** The clientId. */ /** The clientId. */
public Set<String> clientId; public Set<String> clientId;
......
...@@ -39,6 +39,8 @@ import java.util.stream.Collectors; ...@@ -39,6 +39,8 @@ import java.util.stream.Collectors;
*/ */
public class SubsetFilter extends UuidModelFilter<SubsetFilter, Subset> implements IFullTextFilter { public class SubsetFilter extends UuidModelFilter<SubsetFilter, Subset> implements IFullTextFilter {
private static final long serialVersionUID = 7779104030650048760L;
/** Any text. */ /** Any text. */
public String _text; public String _text;
......
...@@ -28,6 +28,8 @@ import org.genesys2.server.model.genesys.Taxonomy2; ...@@ -28,6 +28,8 @@ import org.genesys2.server.model.genesys.Taxonomy2;
*/ */
public class TaxonomyExtraFilter extends TaxonomyFilter { public class TaxonomyExtraFilter extends TaxonomyFilter {
private static final long serialVersionUID = -3827138687385056989L;
/** The overrides. */ /** The overrides. */
public Boolean overrides; public Boolean overrides;
......
...@@ -35,6 +35,8 @@ import com.querydsl.core.types.Predicate; ...@@ -35,6 +35,8 @@ import com.querydsl.core.types.Predicate;
*/ */
public class TaxonomyFilter extends AuditedVersionedModelFilter<TaxonomyFilter, Taxonomy2> { public class TaxonomyFilter extends AuditedVersionedModelFilter<TaxonomyFilter, Taxonomy2> {
private static final long serialVersionUID = 2428438809723761271L;
// Handle synonymous names, null is treated as true // Handle synonymous names, null is treated as true
public Boolean synonyms; public Boolean synonyms;
......
...@@ -29,6 +29,8 @@ import org.genesys2.server.model.grin.TaxonomySpecies; ...@@ -29,6 +29,8 @@ import org.genesys2.server.model.grin.TaxonomySpecies;
*/ */
public class TaxonomySpeciesFilter extends CooperatorOwnedModelFilter<TaxonomySpeciesFilter, TaxonomySpecies> implements IFullTextFilter { public class TaxonomySpeciesFilter extends CooperatorOwnedModelFilter<TaxonomySpeciesFilter, TaxonomySpecies> implements IFullTextFilter {
private static final long serialVersionUID = 7531510842152752326L;
/** Any text. */ /** Any text. */
public String _text; public String _text;
......
...@@ -43,6 +43,8 @@ import com.querydsl.core.types.Predicate; ...@@ -43,6 +43,8 @@ import com.querydsl.core.types.Predicate;
*/ */
public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> { public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> {
private static final long serialVersionUID = 3568921814452373126L;
/** The language. */ /** The language. */
public Set<String> uuid; public Set<String> uuid;
......
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