Пример #1
0
  private <A extends Comparable<A>> Collection<Predicate> comparable(
      ComparableExpression<A> expr, ComparableExpression<A> other, A knownValue) {
    List<Predicate> rv = new ArrayList<Predicate>();
    rv.addAll(exprFilters(expr, other, knownValue));
    rv.add(expr.gt(other));
    rv.add(expr.gt(knownValue));
    rv.add(expr.goe(other));
    rv.add(expr.goe(knownValue));
    rv.add(expr.lt(other));
    rv.add(expr.lt(knownValue));
    rv.add(expr.loe(other));
    rv.add(expr.loe(knownValue));

    //        rv.add(expr.in(IntervalImpl.create(knownValue, null)));
    //        rv.add(expr.in(IntervalImpl.create(null, knownValue)));

    return ImmutableList.copyOf(rv);
  }
Пример #2
0
 @SuppressWarnings("unchecked")
 @Override
 public <RT extends Comparable<?>> ComparableSubQuery<RT> unique(
     ComparableExpression<RT> projection) {
   return new ComparableSubQuery<RT>((Class) projection.getType(), uniqueProjection(projection));
 }