我得到一個JSON例外稱爲‘net.sf.json.JSONException:!有層次結構中的一個週期’有層次結構中的一個週期「JSON
這裏是代碼
Query q = em.createQuery("SELECT e from employee e ");
List<Employee> employeeList = q.getResultList();
JSONObject response = new JSONObject();
response.put("empList", employeeList);
這裏是Employee實體有一對多的關係
public class Employee {
@Id
private String userId;
@JoinColumn(name = "T_MENTORS_userId", referencedColumnName = "userId")
private Collection<Experience> experience;
}
你明白這個問題嗎?你想對此做什麼? – SLaks