-->
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: Problems with lazy loading
PostPosted: Thu Jul 24, 2008 8:51 am 
Newbie

Joined: Thu Jul 24, 2008 6:29 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.4

Name and version of the database you are using: MySQL 5.0

Hi all

I have a table called Teams that has 4 foreign keys to a table called competitors. The way the application is built guarantees that each team will always have all 4 competitors.

I've marked the competitors with @OneToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY) yet every time I load a team I end up loading all 4 competitors.

In one particular situation this is causing a significant performance problem as I only need the Team ID but I have to wait for hibernate to load all competitors for each team before I can retrieve the id, and we're doing this for a lot of teams.

Is there a way to load the teams without loading the competitors?


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.