2

「net.sf.json.JSONException: There is a cycle in the hierarchy!」という JSON 例外が発生しています。

ここにコードがあります

Query q = em.createQuery("SELECT e from employee e ");
List<Employee> employeeList = q.getResultList();
JSONObject response = new JSONObject();
response.put("empList", employeeList);

ここに従業員エンティティがあります。1対多の関係があります

public class Employee {
@Id
private String userId;
    @JoinColumn(name = "T_MENTORS_userId", referencedColumnName = "userId")
private Collection<Experience> experience;
}
4

3 に答える 3