代码1: public PageBase getQueryListTemplate(String templateName, String creater, String startDate, String endDate,
String sortColumn, String dir, PageBase pageBase)
throws ExceptionWithKey
{ PageBase pb = queryTemplateDao.getQueryListTemplate(templateName, creater, startDate, endDate,
sortColumn, dir, pageBase); // 查询 Time Level、Stat.Object两个字段的数据
List<QueryTemplate> list = pb.getItems();
for (QueryTemplate queryTemplate : list)
{
QueryTemplateContent content = queryTemplateContentDao.get(queryTemplate.getId()); String moLevel = this.getMOLevelByID(content.getMoLevel(), false);
content.setMoLevel(moLevel); String timeLevelName = this.getTimeLevelName(content.getTimeLevel());
content.setTimeLevel(timeLevelName);
queryTemplate.setQueryTemplateContent(content);
}
return pb;
}
代码2:public PageBase getQueryTemplate(long templateType, String searchKey,
String sortColumn, String dir, PageBase pageBase)
throws ExceptionWithKey
{ PageBase pb = queryTemplateDao.getQueryTemplate(templateType,
searchKey, sortColumn, dir, pageBase); // 查询 Time Level、Stat.Object两个字段的数据
List<QueryTemplate> list = pb.getItems();
for (QueryTemplate queryTemplate : list)
{
QueryTemplateContent content = queryTemplateContentDao
.get(queryTemplate.getId());
String moLevel = this.getMOLevelByID(content.getMoLevel(), false);
content.setMoLevel(moLevel); String timeLevelName = this.getTimeLevelName(content.getTimeLevel());
content.setTimeLevel(timeLevelName);
queryTemplate.setQueryTemplateContent(content);
}
return pb;
}
String sortColumn, String dir, PageBase pageBase)
throws ExceptionWithKey
{ PageBase pb = queryTemplateDao.getQueryListTemplate(templateName, creater, startDate, endDate,
sortColumn, dir, pageBase); // 查询 Time Level、Stat.Object两个字段的数据
List<QueryTemplate> list = pb.getItems();
for (QueryTemplate queryTemplate : list)
{
QueryTemplateContent content = queryTemplateContentDao.get(queryTemplate.getId()); String moLevel = this.getMOLevelByID(content.getMoLevel(), false);
content.setMoLevel(moLevel); String timeLevelName = this.getTimeLevelName(content.getTimeLevel());
content.setTimeLevel(timeLevelName);
queryTemplate.setQueryTemplateContent(content);
}
return pb;
}
代码2:public PageBase getQueryTemplate(long templateType, String searchKey,
String sortColumn, String dir, PageBase pageBase)
throws ExceptionWithKey
{ PageBase pb = queryTemplateDao.getQueryTemplate(templateType,
searchKey, sortColumn, dir, pageBase); // 查询 Time Level、Stat.Object两个字段的数据
List<QueryTemplate> list = pb.getItems();
for (QueryTemplate queryTemplate : list)
{
QueryTemplateContent content = queryTemplateContentDao
.get(queryTemplate.getId());
String moLevel = this.getMOLevelByID(content.getMoLevel(), false);
content.setMoLevel(moLevel); String timeLevelName = this.getTimeLevelName(content.getTimeLevel());
content.setTimeLevel(timeLevelName);
queryTemplate.setQueryTemplateContent(content);
}
return pb;
}
解决方案 »
- tomcat突然停止
- Struts2 Action 失败后如何返回JAVASCRIPT代码
- Struts中创建ActionForm的异常
- 跳楼求助spring+hibernate配置问题
- 求Apache POI的HWPF jar包。
- 【【高分】】求jforum单点登陆的实例代码!!!【【分不够再加】】
- 为什么在Ecplise中调用jsp不能正常显示,而把文件放到tomcat下单独执行却可以?
- 有关webservice.htc下载?
- 有关EJB中取得数据库中字段值的中文问题!!急!!!
- ejb + hibernate many To many 报org.hibernate.MappingException错误
- Calendar用法求解
- .java文件打不开
看LZ的代码,既然是返回pb,那么遍历可以放在外面来做,既把List,for的部分写到一个方法,比如setContent方法,传入你的pb就可以了