I have to classes that have a one-to-many-relation. When I try to access the lazily loaded collection I get the LazyInitializationException.
I searching the web
You have 2 options.
Option 1 : As mentioned by BetaRide, use the EAGER fetching strategy
Option 2 : After getting the user from database using hibernate, add the below line in of code to load the collection elements:
Hibernate.initialize(user.getCreatedJobs())
This tells hibernate to initialize the collection elements