We have an entity object that contains a collection of another class of entity object.
The contained class is annotated as follows:
@OneToMany(fetch=FetchType.LAZY)
@JoinColumn(name = "TEST_RESULTS_ID", nullable = false)
@IndexColumn(name="POSITION",base=0)
public List<TestCaseResult> getTestCaseResults()
{
return m_testCaseResults;
}
When I find a TestResults object via findById:
entity = (T) getSession().load(getPersistentClass(), id);
Hibernate loads the collection of TestCaseResults, even though they are designated Lazy and not-nullable.
However, it lazily reads collections contained by entities in the TestCaseResuls collection.
What is wrong here? How can we force Hibernate to load the TestCaseResults entities in a lazy manner ?
thanks
|