Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <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:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:aop="http://www.springframework.org/schema/aop"
- 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/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
- <!-- COMMON ************************************************************************** -->
- <bean id="log4jInitialization"
- class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
- lazy-init="false">
- <property name="targetClass"
- value="org.springframework.util.Log4jConfigurer" />
- <property name="targetMethod" value="initLogging" />
- <property name="arguments">
- <list>
- <value>classpath:log4j.properties</value>
- </list>
- </property>
- </bean>
- <context:spring-configured />
- <context:annotation-config />
- <aop:aspectj-autoproxy />
- <tx:annotation-driven
- transaction-manager="transactionManager"/>
- <context:property-placeholder
- location="classpath:database.properties"/>
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- p:driverClassName="${dataSource.driverClassName}"
- p:url="${dataSource.url}"
- p:username="${dataSource.username}"
- p:password="${dataSource.password}"
- />
- <bean id="entityManagerFactory"
- class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
- p:dataSource-ref="dataSource"
- p:persistenceUnitName="data">
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
- </property>
- <property name="jpaProperties">
- <props>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- <prop key="hibernate.archive.autodetection">class</prop>
- <prop key="hibernate.connection.pool_size">1</prop>
- <prop key="hibernate.dialect">org.hibernate.dialect.DerbyDialect</prop>
- <prop key="hibernate.current_session_context_class">thread</prop>
- <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
- <prop key="hibernate.show_sql">true</prop>
- <prop key="hibernate.format_sql">true</prop>
- <prop key="hibernate.use_sql_comments">true</prop>
- </props>
- </property>
- </bean>
- <bean id="transactionManager"
- class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory"
- />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement