self referencing association Mapstruct

ребята можете подсказать как правильно реализовать иерархию используя Mapstruct? имеются:

@Entity
public class Category {
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   private Long id;

   private String title;

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "id_parent")
   private Category parentCategory;

   @OneToMany(mappedBy = "parentCategory")
   private Set<Category> subCategories = new HashSet<>();
}

public class CategoryDto {
   private Long id;
   private String title;
   private Set<CategoryDto> categoryDtos;
}

Ответы (0 шт):