@@ -0,0 +1,1349 @@
+package foam.dao;%0A%0Aimport foam.core.FObject;%0Aimport foam.mlang.order.Comparator;%0Aimport foam.mlang.predicate.Predicate;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by carlos on 2017-05-22.%0A */%0Apublic class JournaledDAO extends ProxyDAO %7B%0A%0A    private FileJournal journal;%0A%0A    public JournaledDAO(DAO delegate, String filename) throws IOException %7B%0A        this.journal = new FileJournal(filename);%0A        this.setDelegate(delegate);%0A        this.journal.replay(delegate);%0A    %7D%0A%0A    /**%0A     * persists data into FileJournal then calls the delegated DAO.%0A     *%0A     * @param obj%0A     * @returns FObject%0A     */%0A    @Override%0A    public FObject put(FObject obj) %7B%0A        this.journal.put(obj, null);%0A        return this.getDelegate().put(obj);%0A    %7D%0A%0A    @Override%0A    public FObject remove(FObject obj) %7B%0A        this.journal.remove(obj, null);%0A        return this.getDelegate().remove(obj);%0A    %7D%0A%0A    @Override%0A    public FObject find(Object id) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Sink select(Sink sink, Integer skip, Integer limit, Comparator order, Predicate predicate) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public void removeAll(Integer skip, Integer limit, Comparator order, Predicate predicate) %7B%0A        this.journal.removeAll();%0A        this.getDelegate().removeAll(skip, limit, order, predicate);%0A    %7D%0A%7D

add main journaled dao class