一方面,我有两个实体建立多对多关系
类别.java:
@ManyToMany()
@JoinTable(
name = "categories_articles",
joinColumns = @JoinColumn(name = "categoryID", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "articleID", referencedColumnName = "id"))
private List<Article> articles = new ArrayList<Article>();
在另一边Article.java:
@ManyToMany(mappedBy = "articles")
private List<Category> categories = new ArrayList<Category>();
加上吸气剂和二传手..
当我在浏览器中加载时出现异常:
failed to lazily initialize a collection of role ... JsonMappingException
有没有人可以帮助我解决这个问题?
我应该编写自己的序列化程序吗?
谢谢和问候!