Spring的基本配置

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url"><value>jdbc:mysql://hunan/netschool?useUnicode=true&characterEncoding=gbk</value>
</property><property name="username"><value>netschool</value></property>
<property name="password"><value>123456</value></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>com/aurora/netschool/entity/Administrator.hbm.xml</value>
<value>com/aurora/netschool/entity/Article.hbm.xml</value>
<value>com/aurora/netschool/entity/ClassCategory.hbm.xml</value>
<value>com/aurora/netschool/entity/Category.hbm.xml</value>
<value>com/aurora/netschool/entity/CustomLable.hbm.xml</value>
<value>com/aurora/netschool/entity/KeyWord.hbm.xml</value>
<value>com/aurora/netschool/entity/Template.hbm.xml</value>
<value>com/aurora/netschool/entity/Popedom.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.query.substitutions">true=1 false=0</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.use_outer_join">true</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>


<bean name="valueListFactory" class="com.aurora.util.valuelist.ValueListFactory">
<property name="constantsHolder">
<value>com.aurora.netschool.Constants</value>
</property>
</bean>

<bean name="configuration" class="com.aurora.Configuration">
<property name="configureMap">
<props>
<prop key="autoAudit">true</prop>
<prop key="graduateDate">07-08</prop>
</props>
</property>
<property name="directoryMap">
<props>
<prop key="tempDir">/tmp</prop>
<prop key="uploadDir">/upload</prop>
</props>
</property>
</bean>
<bean id="articleDao" class="com.aurora.netschool.dao.impl.ArticleDaoImpl" />
<bean id="administratorDao" class="com.aurora.netschool.dao.impl.AdministratorDaoImpl" />
<bean id="categoryDao" class="com.aurora.netschool.dao.impl.CategoryDaoImpl" />
<bean id="keyWordDao" class="com.aurora.netschool.dao.impl.KeyWordDaoImpl" />
<bean id="templateDao" class="com.aurora.netschool.dao.impl.TemplateDaoImpl" />
<bean id="popedomDao" class ="com.aurora.netschool.dao.impl.PopedomDaoImpl"/>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="baseTxProxy" abstract="true" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
<property name="proxyTargetClass">
<value>true</value>
</property>
</bean>
<bean id="articleService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.ArticleServiceImpl" />
</property>
</bean>
<bean id="administratorService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.AdministratorServiceImpl" />
</property>
</bean>
<bean id="popedomService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.PopedomServiceImpl" />
</property>
</bean>
<bean id="categoryService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.CategoryServiceImpl" />
</property>
</bean>
<bean id="keyWordService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.KeyWordServiceImpl" />
</property>
</bean>
<bean id="templateService" parent="baseTxProxy">
<property name="target">
<bean class="com.aurora.netschool.service.impl.TemplateServiceImpl" />
</property>
</bean>
</beans>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值