@@ -0,0 +1,959 @@
+/**%0A * @license%0A * Copyright 2019 The FOAM Authors. All Rights Reserved.%0A * http://www.apache.org/licenses/LICENSE-2.0%0A */%0A%0Apackage foam.dao;%0A%0Aimport foam.core.Detachable;%0Aimport foam.core.FObject;%0Aimport foam.core.X;%0Aimport foam.mlang.order.Comparator;%0Aimport foam.mlang.predicate.Predicate;%0A%0A/** Explicitly freezes objects on select and clones on find. Use in combination with such DAOs as MutableDAO**/%0Apublic class FreezingDAO%0A  extends ProxyDAO%0A%7B%0A  public FreezingDAO(X x, DAO delegate) %7B%0A    super(x, delegate);%0A  %7D%0A%0A  @Override%0A  public FObject find_(X x, Object id) %7B%0A    return getDelegate().find_(x, id).fclone();%0A  %7D%0A%0A  @Override%0A  public Sink select_(X x, Sink sink, long skip, long limit, Comparator order, Predicate predicate) %7B%0A    return getDelegate().select(new AbstractSink() %7B%0A      @Override%0A      public void put(Object obj, Detachable sub) %7B%0A        obj = ((FObject)obj).fclone();%0A        ((FObject) obj).freeze();%0A      %7D%0A    %7D);%0A  %7D%0A%7D%0A

add FreezingDAO