spring的applicationContext.xml
改之前无法删除数据
把del*改成delete*
改之后
改之前无法删除数据
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
把del*改成delete*
改之后
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
本文介绍如何在Spring中通过修改applicationContext.xml文件中的事务管理配置来实现数据的增删改操作。重点在于调整方法名匹配规则,确保数据库删除操作能正确执行。
781

被折叠的 条评论
为什么被折叠?



