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" />
- <!-- 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/"/>
- <property name="suffix" value=".jsp" />
- </bean>
- <!-- Defining the dataSource -->
- <bean id="dataSource" 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>
- <!-- Necessary to get the entity manager injected into the factory bean -->
- <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
- <!-- Define EclipseLink JPA Vendor Adapter -->
- <bean id="jpaVendorAdapter"
- class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
- <property name="databasePlatform"
- value="org.eclipse.persistence.platform.database.MySQLPlatform" />
- <property name="generateDdl" value="false" />
- <property name="showSql" value="true" />
- </bean>
- <!-- Setting up JPA Entity Manager Factory -->
- <bean id="entityManagerFactory"
- class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
- <property name="packagesToScan" value="com.movietime.entities" />
- <property name="persistenceUnitName" value="MovieTime"></property>
- <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
- <property name="dataSource" ref="dataSource"/>
- </bean>
- <!-- Transaction Manager -->
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory" />
- <!-- Detect @Transactional -->
- <tx:annotation-driven transaction-manager="transactionManager" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement