First time asking on stackoverflow, please bear with me
Context: Blog web application backend.
Spring Boot version: 3.2.3
Modelmapper dependency version: 3.1.1
Build tool: Maven
Error: ModelMapper mapping errors:rnrn1) Converter org.modelmapper.internal.converter.MergingCollectionConverter@bd5c6b3 failed to convert org.hibernate.collection.spi.PersistentSet to java.util.Set.rnrn1 error
I am working on comment api. I want that, when I fetch a post, it will also show the comments.
I have a class PostResponse which contains list of PostDto, along with pagination details. I have created a method createPostResponse inside a class PostServiceImpl.java which is responsible for the mapping.
createPostResponse method:
PostResponse.java:
PostDto.java:
Posts.java:
Comments.java:
MyUserResponse.java:
MyUser.java:
Note: I have used setter getter annotations for all the classes.
Suman Maji is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.