Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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:p="http://www.springframework.org/schema/p"
- xmlns:jpa="http://www.springframework.org/schema/data/jpa"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xsi:schemaLocation="http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- 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/data/jpa
- http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
- <tx:annotation-driven transaction-manager="transactionManager"/>
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="emf"/>
- </bean>
- <bean id="emf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" >
- <property name="showSql" value="true" />
- <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
- </bean>
- </property>
- <property name="packagesToScan" value="ru.mrchebik.model"/>
- </bean>
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url" value="jdbc:mysql://localhost:3306/NotesWeb?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8" />
- <property name="username" value="root" />
- <property name="password" value="root" />
- </bean>
- <mvc:annotation-driven />
- <jpa:repositories base-package="ru.mrchebik.repository" entity-manager-factory-ref="emf" transaction-manager-ref="transactionManager"/>
- <context:component-scan base-package="ru.mrchebik.service.impl" />
- <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:prefix="/WEB-INF/views/"
- p:suffix=".jsp"/>
- <mvc:resources mapping="/resources/**" location="/resources/" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement