com.jpattern.orm.jdbctemplate.JPOrmJdbcTemplate Maven / Gradle / Ivy
package com.jpattern.orm.jdbctemplate;
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.PlatformTransactionManager;
import com.jpattern.orm.JPOrm;
/**
*
* @author cinafr
*
*/
public class JPOrmJdbcTemplate extends JPOrm {
/**
* A valid platformTransactionManager is needed to manage Transactions
* @param dataSource
* @param platformTransactionManager
*/
public JPOrmJdbcTemplate(final DataSource dataSource, final PlatformTransactionManager platformTransactionManager) {
this( new JdbcTemplate(dataSource), platformTransactionManager );
}
/**
* A valid platformTransactionManager is needed to manage Transactions
* @param jdbcTemplate
* @param platformTransactionManager
*/
public JPOrmJdbcTemplate(final JdbcTemplate jdbcTemplate, final PlatformTransactionManager platformTransactionManager) {
super(new JdbcTemplateSessionProvider(jdbcTemplate, platformTransactionManager));
}
}