Resolve LazyInitializationException in hibernate

In hibernate transaction when object with child objects is retrieved we should tell hibernate to get all. Such cases often happen in service layer.
The way is to add hibernate annotation for this method.

@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED).

你可能感兴趣的:(Hibernate)