Hi
I work with a hibernate spring application. I have a student domain object and school object. In student, I have the following mapping
Code:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "school_identifier", referencedColumnName = "identifier", nullable = false)
public School getSchool() {
return this.school;
}
In this case, the column 'identifier' is not the primary key of table School.Here I am able to use student.getSchool() outside the session in a view template.However, if the column 'identifier' becomes the primary key of the table Schoolthe code student.getSchool() outside the session in a view template causes LayInitialization ExceptionCan any one please help me in understanding this. It is driving me crazy!
I would be vv thankful if someone explains whats happening here
Thanks
Priya