package com.ejie.ad74a.dao.iml;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcCall;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.ejie.ad74a.dao.ActualizacionExpedientesDao;

/**
 * ActualizacionExpedientesDaoImpl
 * 
 * @author IHERNANG
 */

@Repository
@Transactional
public class ActualizacionExpedientesDaoImpl implements ActualizacionExpedientesDao {

	private JdbcTemplate jdbcTemplate;
	private SimpleJdbcCall jdbcCall;


	/**
	 * Method use to set the datasource.
	 *
	 * @param dataSource DataSource
	 * @return
	 */
	@Resource
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	
	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;

	@Override
	public void actualizarExpedientesX87B() {
		
		this.jdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("P_MIGRACION_DIARIA");
		this.jdbcCall.execute();
		
//		this.jdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("P_MIGRACION_10_UPDATE_EXPS");
//		this.jdbcCall.execute();
	}
}
