// 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.Collection;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;
import com.google.appengine.api.datastore.*;
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.ArrayList;
  @Override
  public int count(Transaction tx, Mapper mapper, Key ancestorKey, Key simpleKey, Filter... filters) {
    final PreparedQuery pq = prepare(mapper.getKind(), true, ancestorKey, simpleKey, null, false, null, false, null, filters);
    return pq.countEntities(FetchOptions.Builder.withDefaults());
  }

  @Override
  public void deleteValue(Transaction tx, Mapper mapper, Key key) throws IOException {
    getSyncService().delete(key);
  }

  @Override
  public void deleteValues(Transaction tx, Mapper mapper, Collection<Key> keys) throws IOException {
    getSyncService().delete(keys);
  }

  @Override
  public Iterable<Entity> queryIterable(Transaction tx, Mapper mapper, boolean keysOnly, int offset, int limit,
                                        Key ancestorKey, Key simpleKey,
                                        String primaryOrderBy, boolean primaryIsAscending,
                                        String secondaryOrderBy, boolean secondaryIsAscending, Filter... filters) {
    final PreparedQuery pq = prepare(mapper.getKind(), keysOnly, ancestorKey, simpleKey,
      primaryOrderBy, primaryIsAscending,
      secondaryOrderBy, secondaryIsAscending, null, filters);

    final QueryResultIterable<Entity> _iterable = asQueryResultIterable(pq, offset, limit);
    return _iterable;
  }

  @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-gae/src/main/java/net/sf/mardao/dao/DatastoreSupplier.java
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;
import com.google.appengine.api.datastore.*;
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.ArrayList;

  @Override
  public int count(Transaction tx, Mapper mapper, Key ancestorKey, Key simpleKey, Filter... filters) {
    final PreparedQuery pq = prepare(mapper.getKind(), true, ancestorKey, simpleKey, null, false, null, false, null, filters);
    return pq.countEntities(FetchOptions.Builder.withDefaults());
  }

  @Override
  public void deleteValue(Transaction tx, Mapper mapper, Key key) throws IOException {
    getSyncService().delete(key);
  }

  @Override
  public void deleteValues(Transaction tx, Mapper mapper, Collection<Key> keys) throws IOException {
    getSyncService().delete(keys);
  }

  @Override
  public Iterable<Entity> queryIterable(Transaction tx, Mapper mapper, boolean keysOnly, int offset, int limit,
                                        Key ancestorKey, Key simpleKey,
                                        String primaryOrderBy, boolean primaryIsAscending,
                                        String secondaryOrderBy, boolean secondaryIsAscending, Filter... filters) {
    final PreparedQuery pq = prepare(mapper.getKind(), keysOnly, ancestorKey, simpleKey,
      primaryOrderBy, primaryIsAscending,
      secondaryOrderBy, secondaryIsAscending, null, filters);

    final QueryResultIterable<Entity> _iterable = asQueryResultIterable(pq, offset, limit);
    return _iterable;
  }

  @Override
  public CursorPage<Entity> queryPage(Transaction tx, Mapper mapper, boolean keysOnly,