Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jdbc="http://www.springframework.org/schema/jdbc"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:jpa="http://www.springframework.org/schema/data/jpa"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
- <beans profile="h2,postgres">
- <jdbc:initialize-database data-source="dataSource" enabled="${database.init}">
- <jdbc:script location="classpath:db/${jdbc.initLocation}"/>
- <jdbc:script encoding="utf-8" location="classpath:db/data.sql"/>
- </jdbc:initialize-database>
- <tx:annotation-driven/>
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
- p:dataSource-ref="dataSource"
- p:packagesToScan="arkhipov.bank">
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
- p:databasePlatform="${jpa.databasePlatform}"
- p:showSql="${jpa.showSql}">
- </bean>
- </property>
- </bean>
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory"/>
- <context:component-scan base-package="arkhipov.bank.repositories"/>
- <jpa:repositories base-package="arkhipov.bank.repositories" entity-manager-factory-ref="entityManagerFactory"
- transaction-manager-ref="transactionManager"/>
- </beans>
- <beans profile="h2">
- <context:property-placeholder location="classpath:db/h2.properties" system-properties-mode="OVERRIDE"/>
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- p:driverClassName="org.h2.Driver"
- p:url="${database.url}"
- p:username="${database.username}"
- p:password="${database.password}"/>
- </beans>
- <beans profile="postgres">
- <context:property-placeholder location="classpath:db/postgres.properties" system-properties-mode="OVERRIDE"/>
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- p:driverClassName="org.postgresql.Driver"
- p:url="${database.url}"
- p:username="${database.username}"
- p:password="${database.password}"/>
- </beans>
- </beans>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jdbc="http://www.springframework.org/schema/jdbc"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:jpa="http://www.springframework.org/schema/data/jpa"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
- <!--<beans profile="h2,postgres">-->
- <jdbc:initialize-database data-source="dataSource" enabled="${database.init}">
- <jdbc:script location="classpath:db/${jdbc.initLocation}"/>
- <jdbc:script encoding="utf-8" location="classpath:db/data.sql"/>
- </jdbc:initialize-database>
- <tx:annotation-driven/>
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
- p:dataSource-ref="dataSource"
- p:packagesToScan="arkhipov.bank">
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
- p:databasePlatform="${jpa.databasePlatform}"
- p:showSql="${jpa.showSql}">
- </bean>
- </property>
- </bean>
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory"/>
- <context:component-scan base-package="arkhipov.bank.repositories"/>
- <jpa:repositories base-package="arkhipov.bank.repositories" entity-manager-factory-ref="entityManagerFactory"
- transaction-manager-ref="transactionManager"/>
- <!--</beans>-->
- <!--<beans profile="h2">-->
- <!--<context:property-placeholder location="classpath:db/h2.properties" system-properties-mode="OVERRIDE"/>-->
- <!--<bean id="dataSource"-->
- <!--class="org.springframework.jdbc.datasource.DriverManagerDataSource"-->
- <!--p:driverClassName="org.h2.Driver"-->
- <!--p:url="${database.url}"-->
- <!--p:username="${database.username}"-->
- <!--p:password="${database.password}"/>-->
- <!--</beans>-->
- <!--<beans profile="postgres">-->
- <context:property-placeholder location="classpath:db/postgres.properties" system-properties-mode="OVERRIDE"/>
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- p:driverClassName="org.postgresql.Driver"
- p:url="${database.url}"
- p:username="${database.username}"
- p:password="${database.password}"/>
- <!--</beans>-->
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement