Commit 855d7fc0 authored by Matija Obreza's avatar Matija Obreza

Model filters should be abstract

- BasicModelFilter declares: public Predicate buildQuery()
parent 1038e7d6
......@@ -26,7 +26,7 @@ import org.genesys.blocks.model.QAuditedVersionedModel;
/**
* {@link AuditedVersionedModel} match by sample filters.
*/
public class AuditedVersionedModelFilter extends VersionedModelFilter {
public abstract class AuditedVersionedModelFilter extends VersionedModelFilter {
/** The created by. */
public Set<Long> createdBy;
......
/*
* Copyright 2017 Global Crop Diversity Trust
* Copyright 2018 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -18,6 +18,7 @@ package org.genesys.blocks.model.filters;
import java.util.Set;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Predicate;
import org.apache.commons.collections4.CollectionUtils;
import org.genesys.blocks.model.BasicModel;
......@@ -26,11 +27,18 @@ import org.genesys.blocks.model.QBasicModel;
/**
* {@link BasicModel} match by sample filters.
*/
public class BasicModelFilter {
public abstract class BasicModelFilter {
/** The id. */
public Set<Long> id;
/**
* Builds the DSL query.
*
* @return the predicate
*/
public abstract Predicate buildQuery();
/**
* Builds the query.
*
......
......@@ -27,7 +27,7 @@ import com.querydsl.core.BooleanBuilder;
/**
* {@link UuidModel} match by sample filters.
*/
public class UuidModelFilter extends AuditedVersionedModelFilter {
public abstract class UuidModelFilter extends AuditedVersionedModelFilter {
/** The created by. */
public Set<UUID> uuid;
......
......@@ -26,7 +26,7 @@ import org.genesys.blocks.model.VersionedModel;
/**
* {@link VersionedModel} match by sample filters.
*/
public class VersionedModelFilter extends BasicModelFilter {
public abstract class VersionedModelFilter extends BasicModelFilter {
/** The version. */
public Set<Integer> version;
......
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