@SuppressWarnings("unchecked") public <A extends Comparable> Collection<Predicate> date( DateExpression<A> expr, DateExpression<A> other, A knownValue) { List<Predicate> rv = new ArrayList<Predicate>(); rv.addAll(comparable(expr, other, knownValue)); rv.addAll(dateOrTime(expr, other, knownValue)); rv.add(expr.dayOfMonth().eq(other.dayOfMonth())); rv.add(expr.month().eq(other.month())); rv.add(expr.year().eq(other.year())); rv.add(expr.yearMonth().eq(other.yearMonth())); if (module.equals(Module.SQL) || module.equals(Module.COLLECTIONS)) { if (target != Target.DERBY) { rv.add(expr.yearWeek().eq(other.yearWeek())); } } return ImmutableList.copyOf(rv); }
@SuppressWarnings("unchecked") @Override public <RT extends Comparable<?>> DateSubQuery<RT> unique(DateExpression<RT> projection) { return new DateSubQuery<RT>((Class) projection.getType(), uniqueProjection(projection)); }