Exemplo n.º 1
0
 @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);
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 @Override
 public <RT extends Comparable<?>> DateSubQuery<RT> unique(DateExpression<RT> projection) {
   return new DateSubQuery<RT>((Class) projection.getType(), uniqueProjection(projection));
 }