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