0

i have a problem, i have 3 objects:

object A: has as attribute a collection of Objetc B

Object B: has as attribute a Object A and a collection of Object C

object C: has as attribute a Object B and a Collection of Object C

I am using MapStruct t do the objects mappers but when i try to mapper this objects, the code enter in infinite loop.

Are there some solution for this problem?

Thanks and sorry for my english, is not my native language.

roberto
  • 163
  • 1
  • 11
  • 1
    Does this answer your question? [Mapstruct bidirectional mapping](https://stackoverflow.com/questions/59895166/mapstruct-bidirectional-mapping) – Deltharis Jul 13 '21 at 10:45
  • I have try it that solution, but it doens't work for me – roberto Jul 13 '21 at 11:01
  • I thinck that the problem is de object C dependency becouse he has a dependency himself – roberto Jul 13 '21 at 11:56
  • You need to correctly apply the solution for https://stackoverflow.com/questions/59895166/mapstruct-bidirectional-mapping to your objects. This is identical to that one – Filip Jul 13 '21 at 16:55
  • I have already tried that solution, but not working for me, using that solution the dependency B en C objects is null, i think that the problem is the objectC dependency himself – roberto Jul 14 '21 at 07:19
  • 1
    This is a solution that in principle should work. You won't get any more responses without providing some code that could allow someone to reproduce your specific issue. – Deltharis Jul 14 '21 at 10:14

0 Answers0