JPA Bidirectional relationship - infinite loop / circular reference
问题 I have a bidirectional relationship @Entity @Table(name = "facility") public class Facility implements Serializable { @Id @GeneratedValue private Long id; @OneToMany(mappedBy = "facility") private Set<Amenity> amenities; } @Entity @Table(name = "amenity") public class Amenity implements Serializable { @Id @GeneratedValue private Long id; @ManyToOne private Facility facility; } This all works fine and I can see the table is created correctly. I can add data fine through a rest endpoint and but