// Path: mardao-core/src/main/java/net/sf/mardao/core/CursorPage.java
// public class CursorPage<T extends Object> implements Serializable {
//     
//     /** requested page size, not acutal */
//     @Deprecated
//     private transient int requestedPageSize;
//     
//     /** provide this to get next page */
//     private String cursorKey;
//     
//     /** the page of items */
//     private Collection<T> items;
// 
//     /**
//      * The total number of items available. Use for progress indication.
//      */
//     private Integer totalSize;
//     
//     public String getCursorKey() {
//         return cursorKey;
//     }
// 
//     public void setCursorKey(String cursorKey) {
//         this.cursorKey = cursorKey;
//     }
// 
//     public Collection<T> getItems() {
//         return items;
//     }
// 
//     public void setItems(Collection<T> items) {
//         this.items = items;
//     }
// 
//     @Deprecated
//     public int getRequestedPageSize() {
//         return requestedPageSize;
//     }
// 
//     @Deprecated
//     public void setRequestedPageSize(int requestedPageSize) {
//         this.requestedPageSize = requestedPageSize;
//     }
// 
//     public Integer getTotalSize() {
//         return totalSize;
//     }
// 
//     public void setTotalSize(Integer totalSize) {
//         this.totalSize = totalSize;
//     }
// 
// }
// 
// Path: mardao-core/src/main/java/net/sf/mardao/core/filter/Filter.java
// public class Filter {
//     private final String column;
//     private final FilterOperator operator;
//     private final Object operand;
// 
//     private Filter(String column, FilterOperator operation, Object operand) {
//         this.column = column;
//         this.operator = operation;
//         this.operand = operand;
//     }
// 
//     /** Builds an EqualsFilter */
//     public static Filter equalsFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.EQUALS, operand);
//     }
// 
//     /** Builds an InFilter */
//     public static Filter inFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.IN, operand);
//     }
// 
//     public static Filter greaterThan(String column, Object operand) {
//         return new Filter(column, FilterOperator.GREATER_THAN, operand);
//     }
// 
//     public static Filter greaterThanOrEquals(String column, Object operand) {
//         return new Filter(column, FilterOperator.GREATER_THAN_OR_EQUALS, operand);
//     }
// 
//     public static Filter lessThan(String column, Object operand) {
//         return new Filter(column, FilterOperator.LESS_THAN, operand);
//     }
// 
//     public static Filter notEqualsFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.NOT_EQUALS, operand);
//     }
// 
//     public String toString() {
//         return column + " " + operator + " " + operand;
//     }
// 
//     public String getColumn() {
//         return column;
//     }
// 
//     public FilterOperator getOperator() {
//         return operator;
//     }
// 
//     public Object getOperand() {
//         return operand;
//     }
// 
// }


import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import net.sf.mardao.core.CursorPage;
import net.sf.mardao.core.filter.Filter;
import java.io.IOException;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.Callable;
package net.sf.mardao.dao;

/*
 * #%L
 * mardao-core
 * %%
 * Copyright (C) 2010 - 2014 Wadpam
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */



/**
 * Stores entities in-memory using a new TreeMap&lt;InMemoryKey, Map&lt;String, Object&gt;&gt;.
 *
 * @author osandstrom Date: 2014-09-03 Time: 20:48
 */
public class InMemorySupplier extends AbstractSupplier<InMemoryKey, Map<String, Object>, Map<String, Object>, Object> {

  public static final String NAME_PARENT_KEY = "__parentKey";
  public static final String NAME_KEY = "__Key";

  private final Map<String, Map<String, Map<String, Object>>> store = new TreeMap<String, Map<String, Map<String, Object>>>();

  @Override
  public Object beginTransaction() {
    return new Object();
  }

  @Override
  public void commitTransaction(Object tx) {

  }

  @Override
  public void rollbackActiveTransaction(Object tx) {

  }

  @Override
// Path: mardao-core/src/main/java/net/sf/mardao/core/CursorPage.java
// public class CursorPage<T extends Object> implements Serializable {
//     
//     /** requested page size, not acutal */
//     @Deprecated
//     private transient int requestedPageSize;
//     
//     /** provide this to get next page */
//     private String cursorKey;
//     
//     /** the page of items */
//     private Collection<T> items;
// 
//     /**
//      * The total number of items available. Use for progress indication.
//      */
//     private Integer totalSize;
//     
//     public String getCursorKey() {
//         return cursorKey;
//     }
// 
//     public void setCursorKey(String cursorKey) {
//         this.cursorKey = cursorKey;
//     }
// 
//     public Collection<T> getItems() {
//         return items;
//     }
// 
//     public void setItems(Collection<T> items) {
//         this.items = items;
//     }
// 
//     @Deprecated
//     public int getRequestedPageSize() {
//         return requestedPageSize;
//     }
// 
//     @Deprecated
//     public void setRequestedPageSize(int requestedPageSize) {
//         this.requestedPageSize = requestedPageSize;
//     }
// 
//     public Integer getTotalSize() {
//         return totalSize;
//     }
// 
//     public void setTotalSize(Integer totalSize) {
//         this.totalSize = totalSize;
//     }
// 
// }
// 
// Path: mardao-core/src/main/java/net/sf/mardao/core/filter/Filter.java
// public class Filter {
//     private final String column;
//     private final FilterOperator operator;
//     private final Object operand;
// 
//     private Filter(String column, FilterOperator operation, Object operand) {
//         this.column = column;
//         this.operator = operation;
//         this.operand = operand;
//     }
// 
//     /** Builds an EqualsFilter */
//     public static Filter equalsFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.EQUALS, operand);
//     }
// 
//     /** Builds an InFilter */
//     public static Filter inFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.IN, operand);
//     }
// 
//     public static Filter greaterThan(String column, Object operand) {
//         return new Filter(column, FilterOperator.GREATER_THAN, operand);
//     }
// 
//     public static Filter greaterThanOrEquals(String column, Object operand) {
//         return new Filter(column, FilterOperator.GREATER_THAN_OR_EQUALS, operand);
//     }
// 
//     public static Filter lessThan(String column, Object operand) {
//         return new Filter(column, FilterOperator.LESS_THAN, operand);
//     }
// 
//     public static Filter notEqualsFilter(String column, Object operand) {
//       return new Filter(column, FilterOperator.NOT_EQUALS, operand);
//     }
// 
//     public String toString() {
//         return column + " " + operator + " " + operand;
//     }
// 
//     public String getColumn() {
//         return column;
//     }
// 
//     public FilterOperator getOperator() {
//         return operator;
//     }
// 
//     public Object getOperand() {
//         return operand;
//     }
// 
// }


// Path: mardao-core/src/main/java/net/sf/mardao/dao/InMemorySupplier.java
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import net.sf.mardao.core.CursorPage;
import net.sf.mardao.core.filter.Filter;
import java.io.IOException;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.Callable;

package net.sf.mardao.dao;

/*
 * #%L
 * mardao-core
 * %%
 * Copyright (C) 2010 - 2014 Wadpam
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */



/**
 * Stores entities in-memory using a new TreeMap&lt;InMemoryKey, Map&lt;String, Object&gt;&gt;.
 *
 * @author osandstrom Date: 2014-09-03 Time: 20:48
 */
public class InMemorySupplier extends AbstractSupplier<InMemoryKey, Map<String, Object>, Map<String, Object>, Object> {

  public static final String NAME_PARENT_KEY = "__parentKey";
  public static final String NAME_KEY = "__Key";

  private final Map<String, Map<String, Map<String, Object>>> store = new TreeMap<String, Map<String, Map<String, Object>>>();

  @Override
  public Object beginTransaction() {
    return new Object();
  }

  @Override
  public void commitTransaction(Object tx) {

  }

  @Override
  public void rollbackActiveTransaction(Object tx) {

  }

  @Override
  public int count(Object tx, Mapper mapper, InMemoryKey ancestorKey, InMemoryKey simpleKey, Filter... filters) {