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]

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

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记