// Path: common-db/src/main/java/org/simpleflatmapper/beans/MappedObject4.java
// public class MappedObject4 {
// 	public static final String SELECT_WITH_LIMIT = "SELECT * FROM TEST_SMALL_BENCHMARK_OBJECT LIMIT ?";
// 
// 	private long id;
// 
// 	private int yearStarted;
// 	private String name;
// 	private String email;
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	public String getEmail() {
// 		return email;
// 	}
// 	public void setEmail(String email) {
// 		this.email = email;
// 	}
// 	public int getYearStarted() {
// 		return yearStarted;
// 	}
// 	public void setYearStarted(int yearStarted) {
// 		this.yearStarted = yearStarted;
// 	}
// 	@Override
// 	public String toString() {
// 		return "MappedObject4 [id=" + id + ", yearStarted="
// 				+ yearStarted + ", name=" + name + ", email=" + email + "]";
// 	}
// 	
// 	
// }
// 
// Path: common-db/src/main/java/org/simpleflatmapper/db/ConnectionParam.java
// @State(Scope.Benchmark)
// public class ConnectionParam {
//     @Param(value="H2")
//     public DbTarget db;
// 
//     public DataSource dataSource;
// 
//     public Connection connection;
// 
//     @Setup
//     public void init() throws SQLException, NamingException {
//         dataSource = ConnectionHelper.getDataSource(db);
// 
//         if (db != DbTarget.MOCK) {
//             Connection conn = dataSource.getConnection();
//             try {
//                 ConnectionHelper.createTableAndInsertData(conn, ConnectionHelper.Table.SMALL);
//                 ConnectionHelper.createTableAndInsertData(conn, ConnectionHelper.Table.BIG);
//             } finally {
//                 conn.close();
//             }
//         }
//         connection = dataSource.getConnection();
// 
//         // Create initial context
//         System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
//                 InitialContextFactory.class.getName());
//         InitialContext ic = new InitialContext();
// 
//         ic.bind("java:datasource", dataSource);
// 
//     }
// 
//     public Connection getConnection() throws SQLException {
//         return dataSource.getConnection();
//     }
// 
//     public void executeStatement(String statement, ResultSetHandler handler, Object... params) throws Exception {
//         PreparedStatement prepareStatement = connection.prepareStatement(statement);
//         try {
//             setParams(prepareStatement, params);
//             ResultSet rs = prepareStatement.executeQuery();
//             try {
//                 handler.handle(rs);
//             }finally {
//                 rs.close();
//             }
//         } finally {
//             prepareStatement.close();
//         }
//     }
// 
//     public void setParams(PreparedStatement prepareStatement, Object[] params) throws SQLException {
//         if (params != null) {
//             for(int i = 0; i < params.length; i++) {
//                 prepareStatement.setObject(i + 1, params[i]);
//             }
//         }
//     }
// }


import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;
import org.simpleflatmapper.jdbc.spring.JdbcTemplateMapperFactory;
import org.simpleflatmapper.beans.MappedObject16;
import org.simpleflatmapper.beans.MappedObject4;
import org.simpleflatmapper.db.ConnectionParam;
import org.simpleflatmapper.db.ResultSetHandler;
import org.simpleflatmapper.param.LimitParam;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
package org.simpleflatmapper.spring;




/*

Benchmark                                 (db)  (limit)   Mode  Cnt     Score     Error  Units
RowMapperBeanPropertyBenchmark._04Fields    H2     1000  thrpt   20   380.087 ±  24.794  ops/s
RowMapperBeanPropertyBenchmark._16Fields    H2     1000  thrpt   20    80.582 ±   3.645  ops/s
RowMapperSfmBenchmark._04Fields             H2     1000  thrpt   20  3515.758 ± 152.728  ops/s
RowMapperSfmBenchmark._16Fields             H2     1000  thrpt   20  1019.907 ±  48.610  ops/s

 */
@State(Scope.Benchmark)
public class RowMapperSfmBenchmark {
// Path: common-db/src/main/java/org/simpleflatmapper/beans/MappedObject4.java
// public class MappedObject4 {
// 	public static final String SELECT_WITH_LIMIT = "SELECT * FROM TEST_SMALL_BENCHMARK_OBJECT LIMIT ?";
// 
// 	private long id;
// 
// 	private int yearStarted;
// 	private String name;
// 	private String email;
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	public String getEmail() {
// 		return email;
// 	}
// 	public void setEmail(String email) {
// 		this.email = email;
// 	}
// 	public int getYearStarted() {
// 		return yearStarted;
// 	}
// 	public void setYearStarted(int yearStarted) {
// 		this.yearStarted = yearStarted;
// 	}
// 	@Override
// 	public String toString() {
// 		return "MappedObject4 [id=" + id + ", yearStarted="
// 				+ yearStarted + ", name=" + name + ", email=" + email + "]";
// 	}
// 	
// 	
// }
// 
// Path: common-db/src/main/java/org/simpleflatmapper/db/ConnectionParam.java
// @State(Scope.Benchmark)
// public class ConnectionParam {
//     @Param(value="H2")
//     public DbTarget db;
// 
//     public DataSource dataSource;
// 
//     public Connection connection;
// 
//     @Setup
//     public void init() throws SQLException, NamingException {
//         dataSource = ConnectionHelper.getDataSource(db);
// 
//         if (db != DbTarget.MOCK) {
//             Connection conn = dataSource.getConnection();
//             try {
//                 ConnectionHelper.createTableAndInsertData(conn, ConnectionHelper.Table.SMALL);
//                 ConnectionHelper.createTableAndInsertData(conn, ConnectionHelper.Table.BIG);
//             } finally {
//                 conn.close();
//             }
//         }
//         connection = dataSource.getConnection();
// 
//         // Create initial context
//         System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
//                 InitialContextFactory.class.getName());
//         InitialContext ic = new InitialContext();
// 
//         ic.bind("java:datasource", dataSource);
// 
//     }
// 
//     public Connection getConnection() throws SQLException {
//         return dataSource.getConnection();
//     }
// 
//     public void executeStatement(String statement, ResultSetHandler handler, Object... params) throws Exception {
//         PreparedStatement prepareStatement = connection.prepareStatement(statement);
//         try {
//             setParams(prepareStatement, params);
//             ResultSet rs = prepareStatement.executeQuery();
//             try {
//                 handler.handle(rs);
//             }finally {
//                 rs.close();
//             }
//         } finally {
//             prepareStatement.close();
//         }
//     }
// 
//     public void setParams(PreparedStatement prepareStatement, Object[] params) throws SQLException {
//         if (params != null) {
//             for(int i = 0; i < params.length; i++) {
//                 prepareStatement.setObject(i + 1, params[i]);
//             }
//         }
//     }
// }


// Path: spring/src/main/java/org/simpleflatmapper/spring/RowMapperSfmBenchmark.java
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;
import org.simpleflatmapper.jdbc.spring.JdbcTemplateMapperFactory;
import org.simpleflatmapper.beans.MappedObject16;
import org.simpleflatmapper.beans.MappedObject4;
import org.simpleflatmapper.db.ConnectionParam;
import org.simpleflatmapper.db.ResultSetHandler;
import org.simpleflatmapper.param.LimitParam;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;

package org.simpleflatmapper.spring;




/*

Benchmark                                 (db)  (limit)   Mode  Cnt     Score     Error  Units
RowMapperBeanPropertyBenchmark._04Fields    H2     1000  thrpt   20   380.087 ±  24.794  ops/s
RowMapperBeanPropertyBenchmark._16Fields    H2     1000  thrpt   20    80.582 ±   3.645  ops/s
RowMapperSfmBenchmark._04Fields             H2     1000  thrpt   20  3515.758 ± 152.728  ops/s
RowMapperSfmBenchmark._16Fields             H2     1000  thrpt   20  1019.907 ±  48.610  ops/s

 */
@State(Scope.Benchmark)
public class RowMapperSfmBenchmark {
	private RowMapper<MappedObject4> mapper4;