I use @JsonIgnore and still get a StackoverflowError.
There is a loop, and the annotation is ignored.
@Entity
@NamedQuery(name="Buch.findAll", query="SELECT b FROM Buch v")
public class Buch implements Serializable {
private static final long serialVersionUID = 1L;
...
@OneToOne(mappedBy="buch")
@JsonIgnore
private Titel Titel;
...
@JsonIgnore
public Titel getTitel() {
return this.verein;
}
@JsonIgnore
public void setTitel(Titel titel) {
this.titel= titel;
}
}
jv123 source
share