heting

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  40 随笔 :: 9 文章 :: 45 评论 :: 0 Trackbacks

 

<?xml version="1.0" encoding="UTF-8"?>
<beans
 
xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation
="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">


 
<bean id="dataSource"
  class
="org.apache.commons.dbcp.BasicDataSource">
  
<property name="driverClassName"
   value
="com.microsoft.jdbc.sqlserver.SQLServerDriver">
  
</property>
  
<property name="url"
   value
="jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=pubs;selectMethod=cursor">
  
</property>
  
<property name="username" value="sa"></property>
 
</bean>
 
<!-- hibernate部分 
 <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref bean="dataSource" />
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">
     org.hibernate.dialect.SQLServerDialect
    </prop>
   </props>
  </property>
  <property name="mappingResources">
  <list><value>hibernate/Users.hbm.xml</value></list>
  
  </property>
  
  
 </bean>
 <bean id="userDao" class="dao.impl.hibernateUsersDaoimpl">
 <property name="sessionFactory" ref="sessionFactory"></property>
 
 </bean>
   hibernate部分 
-->
 
<!-- ibatis部分 -->
 
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
 
<property name="dataSource" ref="dataSource"></property>
 
<property name="configLocation" value="classpath:sqlmapclient.xml"></property> 
 
</bean>
 
<bean id ="userDao" class="dao.impl.ibatisUsersDaoimpl">
 
<property name="sqlMapClient" ref="sqlMapClient"></property>
 
</bean>
 
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
 
<property name="dataSource" ref="dataSource"></property>
 
</bean>
 
<!-- ibatis部分 -->
 
 
 
 
<bean id="realFacade" class="facade.Facade">
 
<property name="userDao" ref="userDao"></property>
 
</bean>
 
<!-- 
 <bean id="transctionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
 <property name="sessionFactory" ref="sessionFactory"/>
 </bean>装备 
-->
 
<!-- 抽象的代理 -->
 
<bean id="abstractProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
 
<property name="transactionManager" ref="transactionManager"></property>
 
<property name="transactionAttributes">
 
<props>
 
<prop key="insert*">PROPAGATION_REQUIRED</prop>
 
<prop key="uptate*">PROPAGATION_REQUIRED</prop>
 
<prop key="dele*">PROPAGATION_REQUIRED</prop>
 
<prop key="sele*">PROPAGATION_REQUIRED,readOnly</prop>
 
<prop key="login*">PROPAGATION_REQUIRED,readOnly</prop>
 
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
 
 
</props>
 
</property>
 
</bean>
 
<!-- 具体的代理 -->
 
<bean id="facade" parent="abstractProxy">
 
<property name="target" ref="realFacade"></property>
 
</bean>
 
<!-- struts -->
 
<bean name="/insert" class="struts.action.InsertAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/login" class="struts.action.LoginAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/getAll" class="struts.action.getAllAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/find" class="struts.action.FindAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/delete" class="struts.action.DeleteAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/update" class="struts.action.UpdateAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
<bean name="/fpage" class="struts.action.FpageAction">
 
<property name="facade" ref="facade"></property>
 
</bean>
 
 
</beans>
posted on 2008-09-17 22:36 贺挺 阅读(120) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: