Modelmapper is giving LazyInitializationException
while converting from entity to dto.
Is there any way i can disable this. If am calling modelmapper.map
inside transaction block it is working fine but it is loading all my lazy objects which i dont want at all.
I want if lazy then do not load it at all.
Converter org.modelmapper.internal.converter.MergingCollectionConverter@6a51c12e failed to convert org.hibernate.collection.internal.PersistentSet to java.util.Set.
Caused by: org.modelmapper.MappingException: ModelMapper mapping errors:
1) Failed to get value from com.app.flashdiary.entity.Vendor.getApproved()
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy [com.app.flashdiary.entity.Vendor#1] - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:169)