I\'m trying to find a way to swap the @JsonBackRefence and the @JsonManagedReference based on what entity I reference from the associated repository.
Site.java>
If I understand you correctly the @JsonIgnoreProperties annotation should help you:
@JsonIgnoreProperties
@JsonIgnoreProperties("site") @OneToMany(mappedBy="site") private List buildings; @JsonIgnoreProperties("buildings") @ManyToOne private Site site;