Commit c0919826 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Update core filters

parent de9e43d2
......@@ -42,7 +42,11 @@ public class DateFilter {
// <
public Date lt;
/** Between is array of two values [a, b]. */
/**
* Between is array of two values [a, b].
*
* @deprecated Use {@link #ge} and {@link #le}
*/
public Date[] between;
/**
......
......@@ -15,6 +15,8 @@
*/
package org.genesys.blocks.model.filters;
import java.util.Set;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.dsl.NumberPath;
......@@ -26,7 +28,7 @@ import com.querydsl.core.types.dsl.NumberPath;
public class NumberFilter<T extends Number & Comparable<?>> {
/** Equal. */
public T eq;
public Set<T> eq;
/** Greater than. */
public T gt;
......@@ -40,7 +42,11 @@ public class NumberFilter<T extends Number & Comparable<?>> {
/** Less than or equal. */
public T le;
/** Between is array of two values [a, b]. */
/**
* Between is array of two values [a, b].
*
* @deprecated Use {@link #ge} and {@link #le}
*/
public T[] between;
/**
......@@ -51,8 +57,8 @@ public class NumberFilter<T extends Number & Comparable<?>> {
*/
public BooleanBuilder buildQuery(final NumberPath<T> val) {
final BooleanBuilder and = new BooleanBuilder();
if (eq != null) {
and.and(val.eq(eq));
if (eq != null && !eq.isEmpty()) {
and.and(val.in(eq));
}
if (gt != null) {
and.and(val.gt(gt));
......
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