I have entities like this:
@Entity
@Table(name = \"ASSESSMENT\")
public class Assessment {
//All other fields..
@OneToMany(fetch = FetchType.LAZY,
Loading AssessmentPart from EntityManager will Load Assessment @ManyToOne(fetch = FetchType.EAGER)
AssessmentPart assessmentPart = //laods a part with entity manager
Assessment assessment = assessmentPart.getAssessment();
Trying to extract AssessmentParts from assessment wont work since it's not @OneToMany(fetch = FetchType.LAZY) and session is already closed
model.put("assessmentParts", assessment.getAssessmentParts());
Get list of AssessmentParts by Assessment from EntityManager in new method should solve the problem.