标签:query dwr 注意 hbm hbm.xml ret json obj length
1.修改请求定区数据的URL
url : "decidedzoneAction_pageQuery.action",
2.修改Decidedzone.hbm.xml,立即加载关联的Staff
<many-to-one name="staff" class="com.hao.bos.entity.Staff" fetch="select" lazy="false">
<column name="staff_id" length="32" />
</many-to-one>
3.编写DecidedzoneAction.pageQuery
/**
* 定区分页查询
*/
public String pageQuery(){
decidedzoneService.pageQuery(pageBean);
object2JsonAndWriteToResponse(pageBean, new String[]{"currentPage", "detachedCriteria", "pageSize", "subareas", "decidedzones"});
return NONE;
}
4.编写DecidedzoneService.pageQuery
@Override
public void pageQuery(PageBean<Decidedzone> pageBean) {
decidedzoneDao.pageQuery(pageBean);
}
5.要注意转化为json时的排除可能导致无限转化的属性
标签:query dwr 注意 hbm hbm.xml ret json obj length
原文地址:http://www.cnblogs.com/tommychok/p/7384202.html