Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.07 KB | None | 0 0
  1.  
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4.    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  5.    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
  6.    xsi:schemaLocation="
  7.        http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
  8.        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  9.        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
  10.        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
  11.  
  12.     <jdbc:embedded-database id="dataSource" type="H2">
  13.         <jdbc:script location="classpath:scripts/create-data-model.sql"/>
  14.         <jdbc:script location="classpath:scripts/fill-database.sql"/>
  15.     </jdbc:embedded-database>
  16.      
  17.     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  18.         <property name="sessionFactory" ref="sessionFactory"/>
  19.     </bean>  
  20.      
  21.     <tx:annotation-driven/>
  22.  
  23.     <context:component-scan base-package="hillel.db_jpa" />
  24.  
  25.     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
  26.         <property name="dataSource" ref="dataSource"/>
  27.         <property name="packagesToScan" value="hillel.db_jpa"/>
  28.         <property name="hibernateProperties">
  29.             <props>
  30.                 <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
  31.                 <prop key="hibernate.max_fetch_depth">3</prop>
  32.                 <prop key="hibernate.jdbc.fetch_size">50</prop>
  33.                 <prop key="hibernate.jdbc.batch_size">10</prop>
  34.                 <prop key="hibernate.show_sql">false</prop>
  35.             </props>
  36.         </property>      
  37.     </bean>
  38.  
  39.     <context:annotation-config/>
  40.  
  41. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement