quick updates and cleanup
This commit is contained in:
parent
b08f53ce48
commit
361343211b
|
@ -5,6 +5,7 @@ import java.util.Properties;
|
|||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -53,9 +54,10 @@ public class PersistenceConfig {
|
|||
}
|
||||
|
||||
@Bean
|
||||
public HibernateTransactionManager transactionManager() {
|
||||
@Autowired
|
||||
public HibernateTransactionManager transactionManager(final SessionFactory sessionFactory) {
|
||||
final HibernateTransactionManager txManager = new HibernateTransactionManager();
|
||||
txManager.setSessionFactory(sessionFactory().getObject());
|
||||
txManager.setSessionFactory(sessionFactory);
|
||||
|
||||
return txManager;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
|
||||
<!-- persistence -->
|
||||
<hibernate.version>4.3.0.Final</hibernate.version>
|
||||
<mysql-connector-java.version>5.1.27</mysql-connector-java.version>
|
||||
<mysql-connector-java.version>5.1.28</mysql-connector-java.version>
|
||||
<tomcat-dbcp.version>7.0.42</tomcat-dbcp.version>
|
||||
|
||||
<!-- logging -->
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Properties;
|
|||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -53,9 +54,10 @@ public class PersistenceConfig {
|
|||
}
|
||||
|
||||
@Bean
|
||||
public HibernateTransactionManager transactionManager() {
|
||||
@Autowired
|
||||
public HibernateTransactionManager transactionManager(final SessionFactory sessionFactory) {
|
||||
final HibernateTransactionManager txManager = new HibernateTransactionManager();
|
||||
txManager.setSessionFactory(sessionFactory().getObject());
|
||||
txManager.setSessionFactory(sessionFactory);
|
||||
|
||||
return txManager;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue