thank you for your quick answer.
You are right with the difference in session.load(...) vs session.get(...).
It solves the LazyInitializationException on the Publisher object.
But nevertheless an exception is thrown when I access the book relationship.
I have changed the code to:
Publisher loadedPublisher = (Publisher) session.get(Publisher.class, publisherId);
Set<Book> books = loadedPublisher.getBooks();
And the Exception is:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: crud.book.model.Publisher.books, no session or session was closedAny ideas?
Again, I can solve this by doing an explicit left join fetch on the relationship property, but what is the lazy attribute in mapping file for if it changes nothing in the behavior of the framework?