随笔分类 - Spring
摘要:配置文件 service类:package com.zhiguoguo.service;import org.springframework.stereotype.Component;@Componentpublic class HelloService { pu...
阅读全文
摘要:前提是引入两个包:org.springframework.test-3.1.3.RELEASE和JUnit4.package com.qk.test;import javax.annotation.Resource;import org.junit.Test;import org.junit.run...
阅读全文
摘要:@Transactional标签用于标记ServiceImpl使用事务,并且能够打开一个sessionFactory的session,并且打开事务。如果在这个标签为@Transactional(propagation = Propagation.NOT_SUPPORTED),就不打开session了...
阅读全文
摘要:环境:我用的是spring3.2,其中引入了quartz-1.5.2.jar先写一个任务类:package com.hlcg.common.task;public class TestJob { public void execute(){ try{ System.out.println("调度"); }catch(Exception ex){ ex.printStackTrace(); } }} 在spring中配置: ...
阅读全文