There was a problem with the implementation of the findAll () methods. When called, Deadlock occurs.
@Data
@Entity
@Table(name = "groups")
public class Group {
/** other fields omitted **/
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Faculty faculty;
}
@Data
@Entity
@Table(name = "faculties")
public class Faculty {
/** other fields omitted **/
@OneToMany( cascade = CascadeType.ALL,
orphanRemoval = true)
private List<Group> groups = new ArrayList<>();
}
Repository:
@Repository
public interface FacultyRepository extends JpaRepository<Faculty, Long> {
}
@Repository
public interface GroupRepository extends JpaRepository<Group, Long> {
}
When I call the findAll () method from the controller,
I installed all the dependencies between the objects as recommended here
Please tell me how to fix this Deadlock=) Thanks)