com.clickntap.autoarchive.RowMover Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Stripecube Show documentation
Show all versions of Stripecube Show documentation
Stripecube is an open source Java framework for Web Applications
package com.clickntap.autoarchive;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.RowMapper;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class RowMover implements RowMapper {
private JdbcTemplate jdbc;
private String table;
private boolean archive;
public RowMover(JdbcTemplate jdbc, String table, boolean archive) {
this.jdbc = jdbc;
this.table = table;
this.archive = archive;
}
public Object mapRow(ResultSet rs, int row) throws SQLException {
String tablePre = "";
if (archive) {
tablePre = "autoarchive_";
}
Number id = null;
final List