发表于: 2017-05-12 13:34:02
1 1135
今天完成的事情:
学习了一波动态sql查询
Map<String, Object> param = DynamicUtil.getCompanyList(name, product, province, city, county,
industry, financing, freezed, approved, returnPage, updateTimeType);
log.info("get param data is " + param);
// 通过动态sql查询获得公司ID列表
ids = companyService.getIdsByDynamicCondition(Company.class, param, start, size);
log.info("get ids is " + ids);
List<Company> companyList = companyService.getObjectsByIds(ids);
for (Company company : companyList) {
Long companyId = company.getId();
log.info("get industry, company is " + company.getId());
//获取行业ID列表
List<Long> industryIdList = companyIndustryService.getCompanyIndustryIdsByCompanyId(companyId, 0, 10);
//将company的professionNum空值设为0
if(company.getProfessionNum()==null)
company.setProfessionNum(0L);
log.info("get industry, industryIdList is " + industryIdList);
//获取行业对象列表
List<CompanyIndustry> industryList = companyIndustryService.getObjectsByIds(industryIdList);
log.info("get industry, industryList is " + industryList);
//给公司的行业列表赋值
company.setCompanyIndustryList(industryList);
}
companyIds = companyService.getIdsByDynamicCondition(Company.class,param, 0, Integer.MAX_VALUE);
log.info("get company data is " + companyList);
model.addAttribute("code", 0);
model.addAttribute("page", page);
model.addAttribute("size", size);
model.addAttribute("total", companyIds.size());
model.addAttribute("companyList", companyList);
}
明天计划的事情:
继续梳理萝卜多方案
遇到的问题:
暂无
收获:
RMI:远程方法调用,它是一种计算机之间对象互相调用对方函数,启动对方进程的一种机制,使用这种机制,某一台计算机上的对象在调用另外一台计算机上的方法时,使用的程序语法规则和在本地上对象间的方法调用的语法规则一样。
为什么RMI要有对象序列化呢?
服务器与客户机之间传递的Java对象必须是可序列化的对象。不可序列化的对象不能在对象流中进行传递。对象序列化扩展了核心 Java输入/输出类,同时也支持对象。对象序列化支持把对象编码以及将通过它们可访问到的对象编码变成字节流;同时,它也支持流中对象图形的互补重构造。序列化用于轻型持久性和借助于套接字或远程方法调用(RMI)进行的通信。
http://blog.csdn.net/is_lie/article/details/6134558
一.创建RMI程序的4个步骤:
1、定义一个远程接口的接口,该接口中的每一个方法必须声明它将产生一个RemoteException异常。
2、定义一个实现该接口的类,要继承UnicastRemoteObject。
3. 创建一个客户程序进行RMI调用。
4、启动rmiRegistry并运行自己的远程服务器和客户程序。
评论