随笔分类 -  Spring

摘要:1、构造方法注入 类中提供构造方法 bean.xml中通过constructor-arg为构造方法的参数赋值 2、setter方法注入 类中提供setter方法 bean.xml中通过property标签配置注入 3、集合的注入方式 类中提供setter方法 package com.alphajun 阅读全文
posted @ 2020-07-07 17:29 AlphaJunS 阅读(198) 评论(0) 推荐(0) 编辑
摘要:1、空参构造方法 2、静态工厂方法 3、实例工厂 bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http:// 阅读全文
posted @ 2020-07-07 15:54 AlphaJunS 阅读(491) 评论(0) 推荐(0) 编辑
摘要:需要在spring配置文件中配置springContextUtil的bean <bean id="SpringContextUtil" lazy-init="false" class="com.alphajuns.ssm.util.SpringContextUtil" /> SpringContex 阅读全文
posted @ 2020-06-10 14:43 AlphaJunS 阅读(235) 评论(0) 推荐(0) 编辑
摘要:以简单的转账案例演示 配置基于xml的声明式事务 在事务中调用非事务形式的方法插入数据到数据库,当前事务被挂起,数据被立即插入到数据库 debug过程 阅读全文
posted @ 2020-04-09 21:28 AlphaJunS 阅读(2330) 评论(0) 推荐(0) 编辑
摘要:<!-- 配置Spring的声明式事务管理 --> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <pr 阅读全文
posted @ 2020-04-09 20:51 AlphaJunS 阅读(333) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示