Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.75 KB | None | 0 0
  1. <beans xmlns="http://www.springframework.org/schema/beans"
  2.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3.     xmlns:p="http://www.springframework.org/schema/p"
  4.     xmlns:mvc="http://www.springframework.org/schema/mvc"
  5.    xmlns:context="http://www.springframework.org/schema/context"
  6.    xmlns:aop="http://www.springframework.org/schema/aop"
  7.    xmlns:tx="http://www.springframework.org/schema/tx"
  8.     xsi:schemaLocation="
  9.     http://www.springframework.org/schema/beans    
  10.     http://www.springframework.org/schema/beans/spring-beans.xsd
  11.     http://www.springframework.org/schema/context
  12.    http://www.springframework.org/schema/context/spring-context.xsd
  13.    http://www.springframework.org/schema/mvc
  14.    http://www.springframework.org/schema/mvc/spring-mvc.xsd
  15.    http://www.springframework.org/schema/aop
  16.    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
  17.    http://www.springframework.org/schema/tx
  18.    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
  19.    
  20.     <!-- Use @Component annotations for bean definitions -->
  21.     <context:component-scan base-package="com.movietime.controller com.movietime.dao
  22.         com.movietime.dataAccessLayer" />
  23.    
  24.     <!-- Use @Controller annotations for MVC controller definitions -->
  25.     <mvc:annotation-driven enable-matrix-variables="true"/>
  26.    
  27.     <!-- View resolver -->
  28.     <bean class=
  29.         "org.springframework.web.servlet.view.InternalResourceViewResolver">
  30.       <property name="prefix" value="/WEB-INF/"/>
  31.     </bean>
  32.  
  33.     <!-- Defining the dataSource -->
  34.     <bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  35.         <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  36.         <property name="url" value="jdbc:mysql://localhost:3306/movietime2" />
  37.         <property name="username" value="root" />
  38.         <property name="password" value="root" />
  39.     </bean>
  40.  
  41.     <!-- setting up JPA EMF -->
  42.     <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
  43.        p:dataSource-ref="dataSource"
  44.        p:packagesToScan="com.movietime.entities" >
  45.         <property name="jpaVendorAdapter">
  46.             <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter" />
  47.         </property>
  48.         <property name="jpaProperties">
  49.             <props>
  50.                
  51.             </props>
  52.         </property>
  53.     </bean>
  54.  
  55.     <!-- Transaction Manager -->
  56.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
  57.        p:entityManagerFactory-ref="entityManagerFactory" />
  58.     <tx:annotation-driven />
  59.  
  60.     <bean id="persistenceExceptionTranslationPostProcessor"
  61.          class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  62.  
  63. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement