/** * @param right * @return */ public BooleanExpression eqAny(CollectionExpression<?, ? super T> right) { return eq(ExpressionUtils.any(right)); }
/** * @param right * @return */ public BooleanExpression neAny(CollectionExpression<?, ? super T> right) { return ne(ExpressionUtils.any(right)); }
@Override public <R,C> R accept(Visitor<R,C> v, C context) { return getValue().accept(v, context); }
/** * Create an alias for the expression * * @return */ @Override @SuppressWarnings("unchecked") public SimpleExpression<T> as(Path<T> alias) { return SimpleOperation.create((Class<T>)getType(),Ops.ALIAS, mixin, alias); }
/** * Create a {@code left in right or...} expression for each list * This method can be removed once we upgrade to QueryDSL 3.6.0 or above, when QueryDSL introduces ExpressionUtils.inAny() * * @param <D> expression type * @param left expression * @param lists * @param <D> * @return a {@code left in right or...} expression */ public <D> Predicate inAny(final SimpleExpression<D> left, final Iterable<? extends List<? extends D>> lists) { BooleanBuilder builder = new BooleanBuilder(); lists.forEach(list -> { builder.or(left.in(list)); }); return builder; } }
/** * Get a {@code nullif(this, other)} expression * * @param other * @return */ public SimpleExpression<T> nullif(T other) { return nullif(ConstantImpl.create(other)); }
/** * Get a {@code nullif(this, other)} expression * * @param other * @return */ @SuppressWarnings("unchecked") public SimpleExpression<T> nullif(Expression<T> other) { return SimpleOperation.create((Class<T>)this.getType(), Ops.NULLIF, this, other); }
/** * Create a SQL IN clause, if necessary partitioning to account for Oracle's maximum of 1000 parameters for each IN clause. * <p> * For Oracle, where the collection has greater than 1000 parameters, the clause will be partitioned into multiple * IN...OR...IN clauses. * </p> * <p> * For other databases, a standard IN clause will be created. * </p> * This method can be removed once we upgrade to QueryDSL 3.6.0 or above, when QueryDSL will split large IN clauses for us. * See https://github.com/querydsl/querydsl/issues/1022 * * @param left left value * @param right right collection * @return the IN clause(s) */ public <D> Predicate partitionedIn(final SimpleExpression<D> left, final Collection<? extends D> right) { if (dbConfig.isOracle() && right.size() > MAX_LIST_SIZE_ORACLE) { final Iterable<? extends List<? extends D>> partitioned = Iterables.partition(right, MAX_LIST_SIZE_ORACLE); return inAny(left, partitioned); } else { return left.in(right); } }
@SuppressWarnings("unchecked") public final BooleanExpression contains(Expression<K> key, Expression<V> value) { return get(key).eq((Expression)value); }
/** * @param right * @return */ public BooleanExpression neAll(CollectionExpression<?, ? super T> right) { return ne(ExpressionUtils.all(right)); }
@Override public <R,C> R accept(Visitor<R,C> v, C context) { return getValue().accept(v, context); }
/** * @param right * @return */ public BooleanExpression eqAll(CollectionExpression<?, ? super T> right) { return eq(ExpressionUtils.all(right)); }
/** * Get a {@code this <> right} expression * * @param right rhs of the comparison * @return */ public BooleanExpression ne(T right) { if (right == null) { throw new IllegalArgumentException("ne(null) is not allowed. Use isNotNull() instead"); } else { return ne(ConstantImpl.create(right)); } }
public BooleanExpression eq(A arg) { return getValue().eq(arg); }
public BooleanExpression ne(Expression<A> expr) { return getValue().ne(expr); }
public BooleanExpression eq(Expression<A> expr) { return getValue().eq(expr); }
public BooleanExpression ne(A arg) { return getValue().ne(arg); }
/** * Get a {@code this == right} expression * * <p>Use expr.isNull() instead of expr.eq(null)</p> * * @param right rhs of the comparison * @return */ public BooleanExpression eq(T right) { if (right == null) { throw new IllegalArgumentException("eq(null) is not allowed. Use isNull() instead"); } else { return eq(ConstantImpl.create(right)); } }
/** * Get a {@code this not in right} expression * * @param right rhs of the comparison * @return */ public BooleanExpression notIn(Collection<? extends T> right) { if (right.size() == 1) { return ne(right.iterator().next()); } else { return BooleanOperation.create(Ops.NOT_IN, mixin, ConstantImpl.create(right)); } }