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:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- 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/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
- <!-- Use @Component annotations for bean definitions -->
- <context:component-scan base-package="com.movietime.controller com.movietime.dao
- com.movietime.dataAccessLayer" />
- <!-- Use @Controller annotations for MVC controller definitions -->
- <mvc:annotation-driven enable-matrix-variables="true"/>
- <!-- View resolver -->
- <bean class=
- "org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/"/>
- </bean>
- <!-- Defining the dataSource -->
- <bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url" value="jdbc:mysql://localhost:3306/movietime2" />
- <property name="username" value="root" />
- <property name="password" value="root" />
- </bean>
- <!-- setting up JPA EMF -->
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
- p:dataSource-ref="dataSource"
- p:packagesToScan="com.movietime.entities" >
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter" />
- </property>
- <property name="jpaProperties">
- <props>
- </props>
- </property>
- </bean>
- <!-- Transaction Manager -->
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory" />
- <tx:annotation-driven />
- <bean id="persistenceExceptionTranslationPostProcessor"
- class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement