@SuppressWarnings("unchecked") public <A extends Comparable> Collection<Predicate> dateTime(DateTimeExpression<A> expr, DateTimeExpression<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(1)); rv.add(expr.dayOfMonth().eq(other.dayOfMonth())); rv.add(expr.month().eq(1)); rv.add(expr.month().eq(other.month())); rv.add(expr.year().eq(2000)); 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())); } } rv.add(expr.hour().eq(1)); rv.add(expr.hour().eq(other.hour())); rv.add(expr.minute().eq(1)); rv.add(expr.minute().eq(other.minute())); rv.add(expr.second().eq(1)); rv.add(expr.second().eq(other.second())); return ImmutableList.copyOf(rv); }