I want to convert my pojo to json with JAXB, my pojo has a one-to-big relationship, and when I convert my pojo to json, JAXB generates the error "Loop detected in object graph. This will result in infinitely deep XML."
I read from the Internet that this problem can be solved with @XmlID and @XmlIDREF, but there is one problem, my attribute identifier is not string, but Long. and as far as I know, @XmlID can only be used with the String property.
Other websites suggest using eclipselink MOXy, but MOXy cannot generate json.
source share