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?