title: spring data lazy loading
body: <p>I use spring data, jpa and hibernate</p>
  
  <p>I have a Advertisement class</p>
  
  <pre><code>@Entity
  public class Advertisement implements Serializable {
  
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
  
    @OneToMany(mappedBy="id", cascade={CascadeType.REMOVE}, fetch=FetchType.LAZY)
    private Set&lt;Message&gt; messages = new HashSet&lt;Message&gt;();
  }
  </code></pre>
  
  <p>and a message class</p>
  
  <pre><code>@Entity
  public class Message implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @ManyToOne(fetch = FetchType.LAZY)
    private Advertisement advertisement;
  }
  </code></pre>
  
  <p>when i search an Advertisement by id, i can see all their message... i don't understand why, i put lazy...</p>
  
  <p>I search a way to load Advertisement without message.</p>