SHARE
TWEET

Untitled

a guest Aug 14th, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:tx="http://www.springframework.org/schema/tx"
  5.        xmlns:context="http://www.springframework.org/schema/context"
  6.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7.        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  8.        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd" >
  9.  
  10.     <!--@Transaction annotation support -->
  11.     <tx:annotation-driven transaction-manager="transactionManager"/>
  12.  
  13.     <context:component-scan base-package="models" />
  14.  
  15.     <!--Activates various annotations to be detected in bean classes: Spring's @Required and @Autowired and so on-->
  16.     <context:annotation-config/>
  17.  
  18.     <bean id="storageService" class="MediaServiceImpl" />
  19.     <bean id = "MediaDAO" class = "MediaDAOImpl" />
  20.  
  21.     <!-- Datasource. Источник данных - база PostgreSQL -->
  22.     <bean id="dataSource"
  23.           class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  24.         <property name="driverClassName" value="org.postgresql.Driver"/>
  25.         <property name="url" value="jdbc:postgresql://localhost:5432/test"/>
  26.         <property name="username" value="pisatel"/>
  27.         <property name="password" value="root"/>
  28.     </bean>
  29.  
  30.      <bean id="jpaVendorAdapter"
  31.           class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  32.         <property name="database" value="POSTGRESQL"/>
  33.         <property name="databasePlatform" value="org.hibernate.dialect.PostgreSQL9Dialect"/>
  34.     </bean>
  35.  
  36.     <bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
  37.  
  38.     <!-- EntityManagerFactory -->
  39.     <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
  40.           id="entityManagerFactory">
  41.         <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
  42.         <property name="persistenceUnitName" value="NewPersistenceUnit"/>
  43.         <property name="dataSource" ref="dataSource"/>
  44.         <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
  45.         <property name="jpaDialect" ref="jpaDialect"/>
  46.     </bean>
  47.  
  48.     <bean id="transactionManager"
  49.           class="org.springframework.orm.jpa.JpaTransactionManager">
  50.         <property name="entityManagerFactory" ref="entityManagerFactory"/>
  51.         <property name="dataSource" ref="dataSource"/>
  52.         <property name="jpaDialect" ref="jpaDialect"/>
  53.     </bean>
  54.  
  55.  
  56. </beans>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top