title: Why does not FetchType.Lazy work?
body: <p>I have model Category. It may have parent Category and list of sub Category. I wrote this questions because could not find case where entity relate to himself.</p>
  
  <p>I tried to implement it like this:</p>
  
  <pre><code>@Entity
  public class Category {
  @Id
  private String id;
  
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "parent_id")
  private Category parent;
  
  @OneToMany(mappedBy = "parent", fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
  private List&lt;Category&gt; subcategories = Lists.newArrayList();
  }
  </code></pre>
  
  <p>I save entities like:</p>
  
  <pre><code>Category parent = new Category();
  parent.setName("parent");
  
  Category child1 = new Category();
  child1.setName("child1");
  child1.setParent(parent);
  
  parent.getSubcategories().add(child1);
  
  categoryPersistence.save(parent);
  </code></pre>
  
  <p>I expected to see something like:</p>
  
  <pre><code>parent {
  id
  parent: null
  childs {
     child {
        id
        parent: ...lazy loading exception...
        childs: null
     }
  }
  }
  </code></pre>
  
  <p>But in child model on filed parent i have recursive loop.
  How to prevent it?</p>
  
  <p>Yeah, i also used @JsonIgnore. But i was not sure is it good practice.
  But if i have a case when i need one Category and i realy need to send it to UI with parent. Is @JsonIgnore can produce this?</p>