// 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/core/filter/FilterOperator.java
// public enum FilterOperator {
//   EQUALS,
//   IN,
//   GREATER_THAN,
//   GREATER_THAN_OR_EQUALS,
//   LESS_THAN,
//   NOT_EQUALS
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.mardao.core.*;
import net.sf.mardao.core.filter.Filter;
import net.sf.mardao.core.filter.FilterOperator;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import javax.persistence.Basic;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.sql.Connection;
import java.util.*;
import java.util.concurrent.Future;
        }
        return filters;
    }

    private String buildSQL(Mapper mapper, String method, Iterable<String> projectionsList,
                            Integer offset, Integer limit, Collection<Object> params, Filter... filters) {
        String projections = "*";
        if (null != projectionsList) {
            StringBuilder sb = new StringBuilder();
            for (String col : projectionsList) {
                if (0 < sb.length()) {
                    sb.append(',');
                }
                sb.append(col);
            }
            projections = sb.toString();
        }

        final StringBuilder sql = new StringBuilder(method)
                .append(projections)
                .append(" FROM ")
                .append(mapper.getKind());
        if (null != filters) {
            boolean isFirst = true;
            for (Filter f : filters) {

                sql.append(isFirst ? " WHERE " : " AND ");
                isFirst = false;
                sql.append(f.getColumn());
                sql.append(getOpsAsSQL(f.getOperator(), f.getOperand()));
// 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/core/filter/FilterOperator.java
// public enum FilterOperator {
//   EQUALS,
//   IN,
//   GREATER_THAN,
//   GREATER_THAN_OR_EQUALS,
//   LESS_THAN,
//   NOT_EQUALS
// }


// Path: mardao-jdbc/src/main/java/net/sf/mardao/dao/JdbcSupplier.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.mardao.core.*;
import net.sf.mardao.core.filter.Filter;
import net.sf.mardao.core.filter.FilterOperator;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import javax.persistence.Basic;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.sql.Connection;
import java.util.*;
import java.util.concurrent.Future;

        }
        return filters;
    }

    private String buildSQL(Mapper mapper, String method, Iterable<String> projectionsList,
                            Integer offset, Integer limit, Collection<Object> params, Filter... filters) {
        String projections = "*";
        if (null != projectionsList) {
            StringBuilder sb = new StringBuilder();
            for (String col : projectionsList) {
                if (0 < sb.length()) {
                    sb.append(',');
                }
                sb.append(col);
            }
            projections = sb.toString();
        }

        final StringBuilder sql = new StringBuilder(method)
                .append(projections)
                .append(" FROM ")
                .append(mapper.getKind());
        if (null != filters) {
            boolean isFirst = true;
            for (Filter f : filters) {

                sql.append(isFirst ? " WHERE " : " AND ");
                isFirst = false;
                sql.append(f.getColumn());
                sql.append(getOpsAsSQL(f.getOperator(), f.getOperand()));
                if (null != f.getOperand() || !FilterOperator.EQUALS.equals(f.getOperator())) {