iteye_18612 2008-09-24 22:21
浏览 194
已采纳

用spring整合hibernate问题

刚刚学习spring,找了段视频看看~想先配置下,不知道哪里错了(spring 1.2和2.0的差别?)

下面是我的配置文件applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
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="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configLocation"
        value="classpath:hibernate.cfg.xml">
    </property>
</bean>



<bean id="man" name="man_name" class="Man">
    <property name="message"
    value="  red">
    </property>
</bean>

<!-- 声明一个hibernate3的事务管理器供代理使用 -->
<bean id="tansactonManager" 
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
        <ref local="sessionFactory" />
    </property>
</bean>

<!-- DAO类 -->
 <bean id="PuserDAO" class="com.red.spring.PuserDAO">
    <property name="sessionFactory">
        <ref bean="sessionFactory" />
    </property>
</bean>  

<!-- DAO代理类 -->




<bean id="PuserDAOProxy"  
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">  


//[b]说是没有setter in PuserDAOProxy[/b]
//[b]说是没有setter in PuserDAOProxy[/b]




PROPAGATION_REQUIRED

<!--

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED,readOnly

PROPAGATION_REQUIRED,readOnly

PROPAGATION_REQUIRES_NEW

-->




  • 写回答

1条回答 默认 最新

  • wxjiaaa 2008-09-25 09:13
    关注

    给你一组我的看下区别吧
    [code="java"]





    class="com.epurse.system.customerSystem.accountManage.service.impl.AccountManageServiceImpl">

    class="com.epurse.system.customerSystem.accountManage.dao.impl.AccountManageDaoImpl">

    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!