These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate insists on eager fetch on lazy read
PostPosted: Wed Aug 27, 2008 6:19 pm 
Newbie

Joined: Wed Aug 27, 2008 5:52 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.