| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /**
- *
- */
- package cn.com.lzt.callable;
- import java.util.HashMap;
- import java.util.concurrent.Callable;
- import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
- /**
- * @author xzx
- *
- * 2019年9月1日
- *
- */
- public abstract class AbstractDataLoadCallable implements Callable<HashMap<String, HashMap<String, Object>>> {
- protected CommonServiceImpl commonService;
-
- public AbstractDataLoadCallable(CommonServiceImpl commonService) {
- super();
- this.commonService = commonService;
- }
- public CommonServiceImpl getCommonService() {
- return commonService;
- }
- public void setCommonService(CommonServiceImpl commonService) {
- this.commonService = commonService;
- }
-
- @Override
- public HashMap<String, HashMap<String, Object>> call() throws Exception {
- commonService.bindHibernateSessionToThread();
- HashMap<String, HashMap<String, Object>> result = loadData();
- commonService.closeHibernateSessionFromThread();
- return result;
- }
-
- abstract HashMap<String, HashMap<String, Object>> loadData() throws Exception;
- }
|