JPA-failed to lazily initialize a collection of role, could not initialize proxy - no Session
前言如果有两个对象,分别时OneSide和ManySide,它们满足一对多的关系,一个OneSide对应多个ManySide。通常我们在JPA中这么定义它们的关系:@Entitypublic class OneSide { @OneToMany(mappedBy = "oneSide") private Set<ManySide> manySides; }@Entitypublic class ManySide { @ManyToOne @JoinColumn p
原创
2020-05-28 18:34:18 ·
1117 阅读 ·
0 评论