日期:2014-05-19 浏览次数:20730 次
JSONObject json = JSONObject.fromObject(this.getMgrMeetingList());
net.sf.json.JSONException: There is a cycle in the hierarchy!
//获取会议室编号 String meet = request.getParameter("meetId"); JsonConfig config = new JsonConfig(); config.setJsonPropertyFilter(new PropertyFilter(){ public boolean apply(Object source, String name, Object value) { if(name.equals("tbmeetroom") || "tbmeetroom" == name || name.equals("tbmeettype") || "tbmeettype" == name ||name.equals("tbmeetfiles") || "tbmeetfiles" == name || name.equals("tbmeetpersons") || "tbmeetpersons" == name ) { return true; } else { return false; } } }); //如果会议编号不为空 if(null !=meet && !"".equals(meet)){ //创建获取星期日期对象 TimeTake time = new TimeTake(); //调用查询方法 this.setMgrMeetingList(mgrService.getMgrByTime(Long.valueOf(meet), time.getTime())); } //创建json对象 JSONObject json = JSONObject.fromObject(this.getMgrMeetingList(),config); result = json.toString(); System.out.println(result); return SUCCESS;
<many-to-one name="tbmeetroom" class="com.boxun.crm.dao.entities.Tbmeetroom" fetch="select"> <column name="HUIYISHI" precision="22" scale="0"> <comment>会议室,外键,和会议室管理主键ID对应</comment> </column> </many-to-one> <many-to-one name="tbmeettype" class="com.boxun.crm.dao.entities.Tbmeettype" fetch="select"> <column name="LEIXING" precision="22" scale="0"> <comment>会议类型,外键,和会议类型表的主键ID相关联</comment> </column> </many-to-one> <set name="tbmeetfiles" inverse="true"> <key> <column name="MEETID" precision="22" scale="0"> <comment>外键,和会议管理主键ID对应</comment> </column> </key> <one-to-many class="com.boxun.crm.dao.entities.Tbmeetfile" /> </set> <set name="tbmeetpersons" inverse="true"> <key> <column name="MEETID" precision="22" scale="0"> <comment>外键,和会议管理主键ID对应</c