Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.01 KB | None | 0 0
  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:context="http://www.springframework.org/schema/context"
  5.     xmlns:tx="http://www.springframework.org/schema/tx"
  6.     xmlns:mvc="http://www.springframework.org/schema/mvc"
  7.     xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  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/tx
  16.         http://www.springframework.org/schema/tx/spring-tx.xsd
  17.         http://www.springframework.org/schema/data/jpa
  18.         http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd">
  19.  
  20.     <!-- Add support for component scanning -->
  21.     <context:component-scan base-package="org.student.filmApp" />
  22.  
  23.     <!-- Add support for conversion, formatting and validation support -->
  24.     <mvc:annotation-driven />
  25.  
  26.     <!-- Define Spring MVC view resolver -->
  27.     <bean
  28.         class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  29.         <property name="prefix" value="/WEB-INF/view/" />
  30.         <property name="suffix" value=".jsp" />
  31.     </bean>
  32.  
  33.     <!-- Define Database DataSource / connection pool -->
  34.     <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource">
  35.         <property name="URL" value="jdbc:oracle:thin:@localhost:1521:orcl" />
  36.         <property name="user" value="" />
  37.         <property name="password" value="" />
  38.     </bean>
  39.  
  40.     <bean id="entityManagerFactory"
  41.         class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  42.         <property name="dataSource" ref="dataSource" />
  43.         <property name="packagesToScan" value="org.student.filmApp.entity" />
  44.         <property name="persistenceProvider">
  45.             <bean class="org.hibernate.jpa.HibernatePersistenceProvider" />
  46.         </property>
  47.         <property name="jpaProperties">
  48.             <props>
  49.                 <prop key="hibernate.dialect">
  50.                     org.hibernate.dialect.Oracle10gDialect
  51.                 </prop>
  52.                 <prop key="hibernate.show_sql">true</prop>
  53.             </props>
  54.         </property>
  55.     </bean>
  56.  
  57.  
  58.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  59.         <property name="entityManagerFactory" ref="entityManagerFactory" />
  60.     </bean>
  61.  
  62.     <!-- Enable configuration of transactional behavior based on annotations -->
  63.     <tx:annotation-driven transaction-manager="transactionManager" />
  64.  
  65.     <!-- Add support for reading web resources: css, images, js, etc ... -->
  66.     <mvc:resources location="/resources/" mapping="/resources/**" />
  67.  
  68.     <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  69.         <property name="basenames">
  70.             <list>
  71.                 <value>classpath:validation</value>
  72.             </list>
  73.         </property>
  74.     </bean>
  75.  
  76.     <jpa:repositories base-package="org.student.filmApp.repository" />
  77.  
  78. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement