Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.27 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:aop="http://www.springframework.org/schema/aop"
  5.       xmlns:tx="http://www.springframework.org/schema/tx"
  6.       xmlns:mvc="http://www.springframework.org/schema/mvc"
  7.       xsi:schemaLocation="
  8.       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  9.       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
  10.       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
  11.       http://www.springframework.org/schema/mvc
  12.       http://www.springframework.org/schema/mvc/spring-mvc-2.0.xsd">
  13.  
  14.     <tx:annotation-driven/>
  15.     <!-- Configure how the entityManager is defined -->
  16.     <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  17.         <property name="dataSource" ref="dataSource" />
  18.         <property name="persistenceUnitName" value="BankingWeb" />
  19.         <property name="jpaVendorAdapter">
  20.             <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  21.                 <property name="generateDdl" value="true" />
  22.                 <property name="showSql" value="true" />
  23.                 <property name="databasePlatform" value="${hibernate.dialect}" />
  24.             </bean>
  25.         </property>
  26.     </bean>
  27.  
  28.     <!-- intercepts @PersistenceContext annotation and injects the EntityManager -->
  29.     <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  30.  
  31.     <!-- Exception translation bean post processor -->
  32.     <bean id="persistenceException" class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
  33.  
  34.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  35.         <property name="entityManagerFactory" ref="entityManagerFactory" />
  36.     </bean>
  37.        
  38.     <!-- your own DAOs -->
  39.     <bean name="userManager" class="ssel.banking.dao.jpa.UserManager" />
  40.     <bean name="accountManager" class="ssel.banking.dao.jpa.AccountManager" />
  41.    
  42.     <bean name="userService" class="ssel.banking.service.UserService" />
  43.     <bean name="bankService" class="ssel.banking.service.BankService" />
  44. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement