I have table A and table B, table B have a fk that rererences to table A.
class EntityA
@Entity
@Table(name = "tableA")
public class EntityA {
... ... ...
@OneToMany(mappedBy="entityA")
private Set<EntityB> entityBList;
}
class EntityB
@Entity
@Table(name = "tableB")
public class EntityB{
... ... ...
@ManyToOne
@JoinColumn(name="id_entityA", nullable=false)
private EntityA entityA;
}
But when i try to call findAll method from repository (from EntityA) i get:
Could not write JSON: Infinite recursion