package foam.dao;

import foam.mlang.predicate.And;
import foam.mlang.predicate.Predicate;
import foam.mlang.order.Comparator;
import foam.dao.Sink;

public class OrderedDAO
  extends ProxyDAO
{
  private foam.mlang.order.Comparator order_;

  public OrderedDAO setOrder(foam.mlang.order.Comparator order) {
    order_ = order;
    return this;
  }

  public Sink select(Sink s, Integer skip, Integer limit, Comparator order, Predicate predicate) {
    return super.select(s, skip, limit, order_, predicate);
  }

  public void removeAll(Integer skip, Integer limit, Comparator order, Predicate predicate) {
    super.removeAll(skip, limit, order_, predicate);
  }
}

@@ -473,32 +473,57 @@
 (s, skip, limit,
+ order_ == null ? order :
  order_, predica
@@ -654,24 +654,49 @@
 skip, limit,
+ order_ == null ? order :
  order_, pre

Fix Java OrderedDAO not using incoming comparator if provided.