我有一个List<SelectConditionHeaderModel>
.
当我编组此列表时,出现错误:
javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.internal.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML
我的抽象父类。
@XmlRootElement
@XmlSeeAlso({ SelectConditionHeaderModel.class,
SelectConditionModel.class })
public abstract class SelectConditionParentModel {
@XmlInverseReference(mappedBy = "conditionList")
SelectConditionParentModel parent;
public SelectConditionParentModel getParent() {
return parent;
}
public void setParent(HbaseSelectConditionParentModel parent) {
this.parent = parent;
}
}
扩展抽象父类的头类
@XmlRootElement
public class SelectConditionHeaderModel extends
SelectConditionParentModel {
List<SelectConditionParentModel> conditionList;
String header;
public List<SelectConditionParentModel> getConditionList() {
return conditionList;
}
public void setConditionList(List<SelectConditionParentModel> condition) {
this.conditionList = condition;
}
public String getHeader() {
return header;
}
public void setHeader(String header) {
this.header = header;
}
}
扩展抽象父级的条件类
@XmlRootElement
public class SelectConditionModel extends SelectConditionParentModel {
String tableName;
public String getTableName() {
return columnFamily;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
}
这个你能帮我吗 。我也使用过 XMLInverseReference,但它似乎不起作用。