This repository has been archived by the owner on Jan 21, 2021. It is now read-only.
forked from SEL-Columbia/dristhi
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create persistence configs for couch and postges to allow one choose …
…database Signed-off-by: Samuel Githengi <samuel.githengi@gmail.com>
- Loading branch information
Showing
3 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | ||
|
||
<context:component-scan base-package="org.opensrp"> | ||
<context:exclude-filter type="regex" | ||
expression="org\.opensrp\.repository\.postgres\..*" /> | ||
</context:component-scan> | ||
|
||
<bean id="opensrpDatabaseConnector" class="org.ektorp.impl.StdCouchDbConnector"> | ||
<constructor-arg value="${couchdb.db.opensrp}" /> | ||
<constructor-arg ref="couchDbInstance" /> | ||
</bean> | ||
|
||
<bean id="opensrpMCTSDatabaseConnector" class="org.ektorp.impl.StdCouchDbConnector"> | ||
<constructor-arg value="${couchdb.db.mcts}" /> | ||
<constructor-arg ref="couchDbInstance" /> | ||
</bean> | ||
|
||
<bean id="opensrpErrorTraceDatabaseConnector" class="org.ektorp.impl.StdCouchDbConnector"> | ||
<constructor-arg value="${couchdb.db.error}" /> | ||
<constructor-arg ref="couchDbInstance" /> | ||
</bean> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:tx="http://www.springframework.org/schema/tx" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | ||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> | ||
|
||
<context:component-scan base-package="org.opensrp"> | ||
<context:exclude-filter type="regex" | ||
expression="org\.opensrp\.repository\.couch\..*" /> | ||
</context:component-scan> | ||
|
||
|
||
<bean id="dataSource" | ||
class="org.springframework.jdbc.datasource.DriverManagerDataSource"> | ||
<property name="driverClassName" value="org.postgresql.Driver" /> | ||
<property name="url" value="jdbc:postgresql://localhost:5432/opensrp" /> | ||
<property name="username" value="opensrp_admin" /> | ||
<property name="password" value="admin" /> | ||
</bean> | ||
|
||
<tx:annotation-driven transaction-manager="transactionManager" /> | ||
<bean id="transactionManager" | ||
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> | ||
<property name="dataSource" ref="dataSource" /> | ||
</bean> | ||
|
||
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | ||
<property name="dataSource" ref="dataSource" /> | ||
<property name="typeAliasesPackage" value="org.opensrp.domain" /> | ||
<property name="mapperLocations" | ||
value="classpath*:org/opensrp/resositories/postgress/mapper/xml/*.xml" /> | ||
</bean> | ||
|
||
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> | ||
<constructor-arg index="0" ref="sqlSessionFactory" /> | ||
</bean> | ||
|
||
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> | ||
<property name="basePackage" value="org.opensrp.repository.postgres.mapper" /> | ||
</bean> | ||
</beans> |