I have been working through the tutorial installed by Hibernate 3.1rc3.
In section
1.3.4 Collection of values, I learned how to modifiy value typed objects:
Code:
private void addEmailToPerson(Long personId, String emailAddress) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Person aPerson = (Person) session.load(Person.class, personId);
// The getEmailAddresses() might trigger a lazy load of the collection
aPerson.getEmailAddresses().add(emailAddress);
session.getTransaction().commit();
}
How can I tune this query using eager fetch?
Thanks a lot,
Dennis