-->
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: Performance problem: bidirectional relation
PostPosted: Wed Jul 02, 2008 10:38 am 
Beginner
Beginner

Joined: Mon Jan 31, 2005 11:04 am
Posts: 21
Dear all,

Working with the latest version of Hibernate and annotation I get a performance problem. Let's have an example with this biderectional relation:

Code:
class Person {
  @OneToMany(mappedBy="person")
  private Set<Address> addresses;
}

class Address {
  @ManyToOne
  private Person person;
}


In a spring DAO support subclass I do something like this to load the dependency.

Code:
getHibernateTemplate().initialize(person.getAddresses);


I then have a select on address table who belongs to the person and for each address I get one select of person instead of fetching this relation with a JOIN. Apparently it is not possible to force this to be a JOIN.

Any body knows how to fix this?

Thanks

Bruno


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.