| Line 14... |
Line 14... |
| 14 |
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
14 |
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
| 15 |
import org.springframework.orm.hibernate5.HibernateTransactionManager;
|
15 |
import org.springframework.orm.hibernate5.HibernateTransactionManager;
|
| 16 |
import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder;
|
16 |
import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder;
|
| 17 |
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
17 |
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
| 18 |
|
18 |
|
| - |
|
19 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 19 |
import com.spice.profitmandi.web.config.AppConfig;
|
20 |
import com.spice.profitmandi.web.config.AppConfig;
|
| 20 |
|
21 |
|
| 21 |
@Configuration
|
22 |
@Configuration
|
| 22 |
@EnableTransactionManagement
|
23 |
@EnableTransactionManagement
|
| 23 |
@ComponentScan({ "com.spice.profitmandi.*" })
|
24 |
@ComponentScan({ "com.spice.profitmandi.*" })
|
| Line 88... |
Line 89... |
| 88 |
@Bean(name = "transactionManager")
|
89 |
@Bean(name = "transactionManager")
|
| 89 |
public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {
|
90 |
public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {
|
| 90 |
HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);
|
91 |
HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);
|
| 91 |
return transactionManager;
|
92 |
return transactionManager;
|
| 92 |
}
|
93 |
}
|
| - |
|
94 |
|
| - |
|
95 |
|
| - |
|
96 |
|
| - |
|
97 |
@Autowired
|
| - |
|
98 |
@Bean
|
| - |
|
99 |
public Mongo mongoClient(SessionFactory sessionFactory) {
|
| - |
|
100 |
Properties properties = new Properties();
|
| - |
|
101 |
try {
|
| - |
|
102 |
properties.load(resource.getInputStream());
|
| - |
|
103 |
} catch (IOException e) {
|
| - |
|
104 |
e.printStackTrace();
|
| - |
|
105 |
}
|
| - |
|
106 |
return new Mongo(properties.getProperty("mongo.host"), properties.getProperty("content.mongo.host"));
|
| - |
|
107 |
}
|
| 93 |
}
|
108 |
}
|