我尝试使用ModelMapper将@Entity转换为DTO,所以出现此错误:
org.modelmapper.MappingException: ModelMapper mapping errors:
1) Converter org.modelmapper.internal.converter.CollectionConverter@f3e6876 failed to convert java.util.List to java.util.List.
1 error
有人可以帮助我吗?
答案 0 :(得分:0)
真正的问题是:
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.example.backapi.aviso.domain.Aviso.links, could not initialize proxy - no Session
解决:
@ElementCollection(fetch = FetchType.LAZY)