package eg;

import java.sql.Connection;
import java.sql.PreparedStatement;

import javax.annotation.PreDestroy;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Alternative;

import org.seamframework.sql.DefaultPreparedStatementFactory;
import org.seamframework.sql.PreparedStatementFactory;

@Dependent @Alternative
public class TestPreparedStatementFactory implements PreparedStatementFactory {
	private DefaultPreparedStatementFactory psf = new DefaultPreparedStatementFactory();

	@Override
	public PreparedStatement createStatement(Connection connection, String sql) {
		return psf.createStatement(connection, sql);
	}
	
	@PreDestroy
	public void closeStatements() {
		psf.closeStatements();
	}

}
