Commit fc9e4fda authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch 'serializable-filters' into 'main'

Serialization for caching

See merge request genesys-pgr/application-blocks!112
parents c690c225 3416ca64
......@@ -25,4 +25,6 @@ import org.genesys.blocks.model.BasicModel;
*/
public abstract class BasicModelFilter<T extends BasicModelFilter<T, R>, R extends BasicModel> extends EmptyModelFilter<T, R> {
private static final long serialVersionUID = -2929992545562763587L;
}
......@@ -15,6 +15,7 @@
*/
package org.genesys.blocks.model.filters;
import java.io.Serializable;
import java.util.Date;
import com.querydsl.core.BooleanBuilder;
......@@ -24,7 +25,9 @@ import com.querydsl.core.types.dsl.TemporalExpression;
/**
* Utility filtering for {@link Date} type.
*/
public class DateFilter {
public class DateFilter implements Serializable {
private static final long serialVersionUID = 7335760829004802798L;
/** Matches records where date is on or after "since" value. */
// >=
......
......@@ -35,6 +35,7 @@ import com.querydsl.core.types.dsl.EntityPathBase;
*/
public abstract class EmptyModelFilter<T extends EmptyModelFilter<T, R>, R extends EmptyModel> extends SuperModelFilter<T, R> {
private static final long serialVersionUID = 3547161067042415815L;
/** The id. */
public Set<Long> id;
......
......@@ -15,6 +15,7 @@
*/
package org.genesys.blocks.model.filters;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
......@@ -26,7 +27,9 @@ import com.querydsl.core.types.dsl.NumberExpression;
*
* @param <T> the generic type
*/
public class NumberFilter<T extends Number & Comparable<?>> {
public class NumberFilter<T extends Number & Comparable<?>> implements Serializable {
private static final long serialVersionUID = -4548157269677617304L;
/** Equal. */
public Set<T> eq;
......
......@@ -16,6 +16,7 @@
package org.genesys.blocks.model.filters;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
......@@ -33,7 +34,9 @@ import com.querydsl.core.types.dsl.StringPath;
/**
* Utility filtering for String types. Matches all constraints.
*/
public class StringFilter {
public class StringFilter implements Serializable {
private static final long serialVersionUID = -1950139291270046687L;
/** Equal. */
@JsonDeserialize(using = StringFilter.SetDeserializer.class)
......
......@@ -16,6 +16,7 @@
package org.genesys.blocks.model.filters;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
......@@ -54,8 +55,9 @@ import com.querydsl.core.types.dsl.SimpleExpression;
* @param <T> the generic type
* @param <R> the generic type
*/
public abstract class SuperModelFilter<T extends SuperModelFilter<T, R>, R> {
public abstract class SuperModelFilter<T extends SuperModelFilter<T, R>, R> implements Serializable {
private static final long serialVersionUID = -4298821420228268854L;
private static final ObjectMapper jsonizer = new ObjectMapper();
private static final ObjectMapper nonDefault = new ObjectMapper();
private static final ObjectMapper defaultMapper = new ObjectMapper();
......
......@@ -34,6 +34,8 @@ import com.querydsl.core.types.dsl.EntityPathBase;
*/
public abstract class VersionedModelFilter<T extends VersionedModelFilter<T, R>, R extends VersionedModel> extends BasicModelFilter<T, R> {
private static final long serialVersionUID = -4226770121644301621L;
/** The version. */
public Set<Integer> version;
......
......@@ -34,6 +34,8 @@ import com.querydsl.core.types.dsl.EntityPathBase;
*/
public abstract class AuditedVersionedModelFilter<T extends AuditedVersionedModelFilter<T, R>, R extends AuditedVersionedModel> extends VersionedModelFilter<T, R> {
private static final long serialVersionUID = 4488044011334369267L;
/** The created by. */
public Set<Long> createdBy;
......
......@@ -38,6 +38,8 @@ import com.querydsl.core.types.dsl.EntityPathBase;
*/
public abstract class UuidModelFilter<T extends UuidModelFilter<T, R>, R extends AuditedVersionedModel> extends AuditedVersionedModelFilter<T, R> {
private static final long serialVersionUID = -2866906205548608641L;
/** The created by. */
@JsonDeserialize(contentUsing = UUIDDeserializer.class)
public Set<UUID> 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