JsonConfig cfg = new JsonConfig();
cfg.setJsonPropertyFilter(new PropertyFilter()
{
public boolean apply(Object source, String name, Object value) {
if(name.equals("wares")) {
return true;
} else {
return false;
}
}
如上代码把一个实体类中关联的外键表过滤掉了,但是需要访问该外键表中的属性该如何做呀
求一个好的解决办法,在线等急。
cfg.setJsonPropertyFilter(new PropertyFilter()
{
public boolean apply(Object source, String name, Object value) {
if(name.equals("wares")) {
return true;
} else {
return false;
}
}
如上代码把一个实体类中关联的外键表过滤掉了,但是需要访问该外键表中的属性该如何做呀
求一个好的解决办法,在线等急。
如果不过滤掉会报net.sf.json.JSONException: There is a cycle in the hierarchy!异常
这是由外键关系引起的。
我不想过滤掉的。
这是由外键关系引起的。
我不想过滤掉的。
我以前写的一个J2EE项目,用的Spring+hibernate(annotation,非xml配置),学生公寓缴费管理系统
里面有全套的代码,希望对你有帮助