boot-starter-uflo.2.4.2.v20201205.source-code.uflo-spring-context.xml Maven / Gradle / Ivy
<?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:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd "> <!-- 导入nutzboot的spring定义 --> <import resource="classpath:META-INF/spring/nutzboot-spring-context.xml" /> <!-- 导入uflo的spring定义 --> <import resource="classpath:uflo-console-context.xml" /> <!-- uflo需要一个EnvironmentProvider --> <bean id="uflo.environmentProvider" class="org.nutz.boot.starter.uflo.UfloEnvironmentProvider"> <property name="platformTransactionManager" ref="uflo.transactionManager" /> <property name="sessionFactory" ref="uflo.sessionFactory" /> </bean> <!-- uflo总是依赖hibernate,那就给它咯 --> <bean id="uflo.sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <property name="dataSource" ref="nutz.dataSource" /> <property name="packagesToScan"> <list> <value>com.bstek.uflo.model*</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> </bean> <!-- 还需要事务管理器 --> <bean id="uflo.transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> <property name="sessionFactory" ref="uflo.sessionFactory"/> </bean> </beans>