public BooleanExpression between(@Nullable Expression<T> from, @Nullable Expression<T> to) {
        if (from == null) {
            if (to != null) {
                return Expressions.booleanOperation(Ops.LOE, mixin, to);
            } else {
                throw new IllegalArgumentException("Either from or to needs to be non-null");
            }
        } else if (to == null) {
            return Expressions.booleanOperation(Ops.GOE, mixin, from);
        } else {
            return Expressions.booleanOperation(Ops.BETWEEN, mixin, from, to);
        }

    }
Create a {@code this between from and to} expression

<p>Is equivalent to {@code from <= this <= to}</p>

@param from inclusive start of range
@param to inclusive end of range
@return this between from and to
querydsl-core/src/main/java/com/querydsl/core/types/dsl/ComparableExpression.java