title: In a ManyToMany birdirectional mapping findAll() gets rows, each containing its children which in-turn contains itself
body: <p>I have data model with ManyToMany bidirectional mapping as follows.</p>
  
  <p>A product can have multiple categories, similarly categories can have multiple products. I am using a link table to maintain the relation.</p>
  
  <p>'Categories' entity is defined as follows:</p>
  
  <pre><code>@Entity(name = "categories")
  class Categories(
          @Id
          @GeneratedValue
          @Column(name="cat_id", unique = true, nullable = false)
          var id: Integer,
          @ManyToMany(fetch = FetchType.LAZY)
          @JoinTable(name = "categories_product", joinColumns = [JoinColumn(name = "cat_id")], inverseJoinColumns = [JoinColumn(name = "prd_id")])
          @JsonIgnoreProperties("productsSet")
          var productsSet: MutableSet&lt;Products&gt;
  )
  </code></pre>
  
  <p>And 'Products' entity has a List as an inverse mapping as:</p>
  
  <pre><code>@Entity(name = "products")
  class Products(
          @Id
          @GeneratedValue
          @Column(name="prd_id", unique = true, nullable = false)
          var id: Integer,
          @ManyToMany(fetch = FetchType.LAZY, mappedBy = "productsSet")
          @JsonIgnoreProperties("productsSet")
          var categories: MutableSet&lt;Categories&gt;
  )
  </code></pre>
  
  <p>My mapping table 'categories_product' has two columns 'cat_id' and 'prd_id' that references the 'categories' and 'products' table respectively.</p>
  
  <p>I have a ProductsRepository and CategoriesRepository that implements CrudRepository.</p>
  
  <p>Calling findAll() from mappedBy side which is ProductsRepository works fine, as shown below:</p>
  
  <pre><code>[
     {
        "id":1,
        "name":"Cricket Bat",
        "price":10.0,
        "categories":[
           {
              "id":1,
              "name":"Sports",
              "description":"Sports items"
           }
        ]
     },
     {
        "id":2,
        "name":"Spring Boot",
        "price":100.0,
        "categories":[
           {
              "id":2,
              "name":"Books",
              "description":"Book items"
           }
        ]
     }
  ]
  </code></pre>
  
  <p>However, calling findAll() from owning side which is Categories returns all its products which contains its referenced categories as well, as shown below:</p>
  
  <pre><code>[
     {
        "id":1,
        "name":"Sports",
        "description":"Sports items",
        "productsSet":[
           {
              "id":1,
              "name":"Cricket Bat",
              "price":10.0,
              "categories":[
                 {
                    "id":1,
                    "name":"Sports",
                    "description":"Sports items"
                 }
              ]
           }
        ]
     },
     {
        "id":2,
        "name":"Books",
        "description":"Book items",
        "productsSet":[
           {
              "id":2,
              "name":"Spring Boot",
              "price":100.0,
              "categories":[
                 {
                    "id":2,
                    "name":"Books",
                    "description":"Book items"
                 }
              ]
           }
        ]
     }
  ]
  </code></pre>
  
  <p>How do I make findAll() from owning side (CategoriesRepository) return only its children not children's children as in the mapping side (ProductsRepository)?</p>